# -*- coding: utf-8 -*-#
import random, datetime, itertools
from itertools import cycle, repeat
import numpy as np
from bidict import bidict
import cn2an
from cn2an import an2cn
from sxtwl import fromSolar
import re
import math
import ephem
from ephem import Sun, Date, Ecliptic, Equatorial

wuxing = "火水金火木金水土土木,水火火金金木土水木土,火火金金木木土土水水,火木水金木水土火金土,木火金水水木火土土金"
wuxing_relation_2 = dict(
    zip(list(map(lambda x: tuple(re.findall("..", x)), wuxing.split(","))), "克我,我克,比和,生我,我生".split(",")))
yingyang = {tuple(list("甲丙戊庚壬")): "阳", tuple(list("乙丁己辛癸")): "阴"}
zhiying = dict(zip("寅巳申丑戌未子卯辰亥酉午", "巳申寅戌未丑卯子辰亥酉午"))
ying_chong = dict(zip(list(map(lambda x: tuple(x), "寅巳申丑戌未子卯,午辰酉亥".split(","))), "刑,自刑".split(",")))
yingke = {('寅巳', '巳申', '申寅', '丑戌', '戌未', '未丑', '子卯', '卯子', '辰辰', '亥亥', '酉酉', '午午'): "刑"}
tian_gan = '甲乙丙丁戊己庚辛壬癸'
di_zhi = '子丑寅卯辰巳午未申酉戌亥'
base_data={'上卦数': [['8,6,3', '8,8,0', '8,10,4'], ['4,8,0', '4,10,4', '4,0,2'], ['9,1,4', '9,11,2', '9,9,0'], ['5,9,0', '5,7,4', '5,5,3'], ['6,6,3', '6,8,0', '6,10,4'], ['2,10,4', '2,0,2', '2,2,1'], ['7,7,4', '7,5,3', '7,3,1'], ['3,11,2', '3,9,0', '3,7,4']], '下卦数': [['0,0,2', '0,2,1', '0,4,4'], ['4,2,1', '4,4,4', '4,6,3'], ['1,7,4', '1,5,3', '1,3,1'], ['5,3,1', '5,1,4', '5,11,2'], ['6,0,2', '6,2,1', '6,4,4'], ['2,4,4', '2,6,3', '2,8,0'], ['7,1,4', '7,11,2', '7,9,0'], ['3,5,3', '3,3,1', '3,1,4']], '世应排法': ['初二应四五世', '世二三应五六', '初世三四应六', '初二世四五应', '初二三世五应', '初应三四世六', '应二三世五六', '初二世四五应'], '世身': {('丑', '未'): 1, ('卯', '酉'): 3, ('子', '午'): 0, ('寅', '申'): 2, ('巳', '亥'): 5, ('辰', '戌'): 4}, '二十八宿': ['角', '亢', '氐', '房', '心', '尾', '箕', '斗', '牛', '女', '虚', '危', '室', '壁', '奎', '娄', '胃', '昴', '毕', '觜', '参', '井', '鬼', '柳', '星', '张', '翼', '轸'], '二十八宿配干支': ['壬戌', '辛丑', '丙辰', '乙卯', '辛未', '丙子', '己酉', '甲辰', '庚戌', '乙未', '戊辰', '辛酉', '癸丑', '戊戌', '丁亥', '庚辰', '戊子', '丁巳', '庚寅', '己亥', '丁亥', '庚申', '癸丑', '戊午', '丙寅', '己卯', '甲寅', '丁丑', '己酉', '壬申', '辛未', '丙申', '癸酉', '庚子', '丁卯', '甲辰', '庚午', '丁酉', '戊申', '乙卯', '辛卯', '甲子', '己丑', '庚辰', '壬午', '己未', '丙戌', '辛酉', '己巳', '丙辰', '辛亥', '戊午', '丙戌', '辛巳', '壬午', '己亥', '丁未', '戊寅', '乙巳', '丙申', '戊申', '癸亥', '庚午', '丁丑'], '五星': ['镇星', '太白', '太阴', '岁星', '荧惑'], '五行': ['金', '木', '水', '火', '土'], '八卦': ['乾', '坎', '坤', '离', '震', '艮', '巽', '兑'], '八卦六爻五行': ['水木土火金土', '木土火金土水', '土火木土水金', '木土水金土火', '水木土火金土', '土火金土水木', '土水金土火木', '火木土水金土'], '八卦卦象': {1: '天', 2: '泽', 3: '火', 4: '雷', 5: '风', 6: '水', 7: '山', 8: '地'}, '八卦数值': {1: '777', 2: '778', 3: '787', 4: '788', 5: '877', 6: '878', 7: '887', 8: '888'}, '八宫卦': {('乾', '坎', '坤', '离', '震', '艮', '巽', '兑'): '本宫', ('剥', '井', '丰', '履', '夬', '噬嗑', '涣', '谦'): '五世', ('否', '恒', '既济', '损', '泰', '益', '未济', '咸'): '三世', ('大有', '随', '师', '渐', '比', '蛊', '同人', '归妹'): '归魂', ('姤', '豫', '节', '贲', '复', '小畜', '旅', '困'): '一世', ('晋', '大过', '明夷', '中孚', '需', '颐', '讼', '小过'): '游魂', ('观', '升', '革', '睽', '大壮', '无妄', '蒙', '蹇'): '四世', ('遯', '解', '屯', '大畜', '临', '家人', '鼎', '萃'): '二世'}, '八宫卦五行': {('乾', '姤', '遯', '否', '观', '剥', '晋', '大有'): '金', ('兑', '困', '萃', '咸', '蹇', '谦', '小过', '归妹'): '金', ('坎', '节', '屯', '既济', '革', '丰', '明夷', '师'): '水', ('坤', '复', '临', '泰', '大壮', '夬', '需', '比'): '土', ('巽', '小畜', '家人', '益', '无妄', '噬嗑', '颐', '蛊'): '木', ('艮', '贲', '大畜', '损', '睽', '履', '中孚', '渐'): '土', ('离', '旅', '鼎', '未济', '蒙', '涣', '讼', '同人'): '火', ('震', '豫', '解', '恒', '升', '井', '大过', '随'): '木'}, '八宫卦纯卦': {('乾', '姤', '遯', '否', '观', '剥', '晋', '大有'): '777777', ('兑', '困', '萃', '咸', '蹇', '谦', '小过', '归妹'): '778778', ('坎', '节', '屯', '既济', '革', '丰', '明夷', '师'): '878878', ('坤', '复', '临', '泰', '大壮', '夬', '需', '比'): '888888', ('巽', '小畜', '家人', '益', '无妄', '噬嗑', '颐', '蛊'): '877877', ('艮', '贲', '大畜', '损', '睽', '履', '中孚', '渐'): '887887', ('离', '旅', '鼎', '未济', '蒙', '涣', '讼', '同人'): '787787', ('震', '豫', '解', '恒', '升', '井', '大过', '随'): '788788'}, '六十四卦': ['乾', '姤', '遯', '否', '观', '剥', '晋', '大有', '震', '豫', '解', '恒', '升', '井', '大过', '随', '坎', '节', '屯', '既济', '革', '丰', '明夷', '师', '艮', '贲', '大畜', '损', '睽', '履', '中孚', '渐', '坤', '复', '临', '泰', '大壮', '夬', '需', '比', '巽', '小畜', '家人', '益', '无妄', '噬嗑', '颐', '蛊', '离', '旅', '鼎', '未济', '蒙', '涣', '讼', '同人', '兑', '困', '萃', '咸', '蹇', '谦', '小过', '归妹'], '六兽': ['青龙', '朱雀', '勾陈', '腾蛇', '白虎', '玄武'], '六亲': ['父母', '兄弟', '官鬼', '妻财', '子孙'], '六亲五行': {('土金', '水木', '金水', '火土', '木火'): '父', ('水金', '金土', '木水', '土火', '火木'): '子', ('火金', '水火', '金木', '木土', '土水'): '官', ('金火', '火水', '木金', '土木', '水土'): '妻', ('金金', '木木', '水水', '火火', '土土'): '兄'}, '单双地支': {'0': ['子', '寅', '辰', '午', '申', '戌'], '1': ['未', '巳', '卯', '丑', '亥', '酉']}, '干': ['甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸'], '支': ['子', '丑', '寅', '卯', '辰', '巳', '午', '未', '申', '酉', '戌', '亥'], '数字排八卦': {('766', '966', '788', '788', '786', '786', '786', '966', '966', '766', '988', '986', '788', '986', '986', '988', '768', '986', '966', '786', '766', '988', '968', '986', '968', '788', '968', '786', '768', '988', '988', '786', '966', '768', '788', '786', '986', '988', '968', '986', '988', '788', '768', '968', '768', '786', '968', '966', '766', '766', '966', '766', '766', '968', '766', '788', '988', '968', '966', '768', '788', '768', '986', '768'): '震', ('776', '796', '976', '778', '778', '978', '976', '978', '798', '976', '976', '998', '998', '796', '776', '976', '776', '998', '996', '998', '998', '796', '778', '978', '798', '798', '978', '776', '998', '996', '796', '778', '776', '978', '996', '996', '798', '776', '976', '798', '996', '778', '796', '978', '798', '796', '798', '778', '978', '776', '996', '996', '998', '776', '798', '998', '996', '778', '976', '778', '978', '976', '796', '796'): '兑', ('797', '999', '997', '779', '797', '979', '979', '777', '979', '779', '977', '777', '977', '777', '777', '799', '799', '799', '997', '999', '997', '997', '979', '799', '999', '779', '799', '979', '779', '997', '997', '977', '977', '777', '797', '777', '997', '977', '797', '999', '779', '779', '977', '797', '997', '799', '779', '797', '779', '979', '999', '799', '977', '999', '777', '799', '999', '979', '777', '999', '797', '979', '977', '797'): '乾', ('867', '689', '687', '667', '867', '689', '669', '867', '867', '867', '667', '687', '869', '689', '889', '689', '689', '869', '669', '667', '669', '869', '887', '867', '689', '687', '887', '669', '687', '669', '889', '669', '889', '869', '687', '867', '889', '669', '869', '887', '887', '667', '667', '667', '889', '889', '687', '889', '887', '869', '669', '687', '887', '667', '869', '887', '689', '889', '869', '887', '687', '867', '667', '689'): '艮', ('877', '877', '699', '697', '699', '879', '697', '899', '699', '677', '879', '679', '879', '897', '679', '877', '879', '877', '677', '677', '877', '699', '879', '897', '679', '699', '899', '897', '897', '899', '677', '877', '897', '677', '699', '697', '877', '897', '899', '677', '897', '899', '897', '677', '679', '679', '679', '679', '697', '899', '699', '879', '879', '697', '697', '877', '679', '697', '677', '699', '899', '697', '899', '879'): '巽', ('878', '696', '678', '696', '876', '678', '876', '878', '696', '896', '876', '896', '676', '676', '698', '898', '698', '878', '876', '898', '878', '898', '878', '878', '676', '676', '696', '678', '696', '878', '698', '698', '876', '898', '676', '698', '678', '676', '896', '878', '698', '876', '696', '696', '898', '678', '898', '698', '678', '678', '896', '678', '898', '876', '896', '696', '876', '676', '896', '698', '676', '898', '896', '896'): '坎', ('886', '688', '666', '686', '688', '666', '866', '668', '668', '888', '886', '868', '686', '886', '688', '868', '666', '686', '688', '888', '668', '686', '886', '866', '666', '668', '888', '686', '666', '868', '668', '886', '888', '666', '866', '866', '688', '868', '686', '868', '868', '868', '668', '666', '886', '866', '688', '686', '866', '866', '866', '668', '668', '886', '888', '888', '686', '886', '666', '688', '888', '868', '888', '688'): '坤', ('967', '987', '769', '989', '987', '767', '787', '767', '967', '767', '969', '789', '967', '967', '969', '789', '789', '969', '987', '789', '767', '787', '987', '969', '989', '787', '967', '769', '767', '769', '989', '769', '767', '787', '989', '767', '787', '969', '787', '787', '987', '769', '767', '969', '987', '967', '989', '967', '789', '787', '967', '769', '987', '989', '789', '769', '989', '789', '969', '987', '769', '789', '989', '969'): '离'}, '数字排六十四卦': {('666678', '668876', '866678', '888896', '866698', '686876', '888678', '686896', '686898', '868876', '686676', '886898', '666698', '868898', '688878', '866878', '886678', '868696', '866876', '668698', '686878', '868896', '886878', '666676', '666898', '688678', '866898', '688898', '868878', '888878', '888696', '668678', '686698', '686696', '886696', '666896', '868678', '888698', '668898', '668878', '666878', '888676', '886896', '866896', '688676', '888876', '668696', '886876', '868676', '866696', '688896', '668896', '886676', '686678', '688876', '888898', '868698', '886698', '866676', '666876', '688698', '668676', '688696', '666696'): '比', ('667776', '889796', '889976', '689796', '887776', '687796', '687996', '869996', '869776', '887996', '669798', '667996', '669778', '887998', '689976', '667978', '869796', '667998', '669978', '869976', '867776', '887798', '887796', '889998', '687978', '869778', '869798', '889776', '669776', '867796', '867798', '687798', '667976', '867778', '669976', '867998', '669796', '887978', '669996', '867978', '669998', '889978', '869998', '689978', '689778', '687976', '887976', '689798', '887778', '689998', '667778', '687778', '689996', '687998', '687776', '667798', '889778', '689776', '889996', '667796', '867976', '867996', '869978', '889798'): '咸', ('667999', '689779', '887797', '687997', '687797', '689997', '869797', '887779', '887799', '887999', '869999', '889799', '689977', '887979', '687777', '887977', '889997', '889797', '689999', '689979', '687979', '867779', '669799', '669997', '669979', '689777', '867777', '867997', '667997', '889977', '887997', '869997', '669977', '687977', '869979', '869779', '889979', '687999', '869777', '867797', '669999', '667799', '687779', '889779', '869977', '667979', '687799', '869799', '669777', '867979', '867799', '689797', '669797', '889777', '667777', '667779', '689799', '889999', '667977', '867999', '667797', '867977', '669779', '887777'): '遯', ('669876', '669896', '687876', '689698', '889676', '889678', '687696', '887676', '889896', '867676', '669676', '887678', '689678', '687896', '867898', '689878', '867896', '889696', '667696', '667678', '689876', '667878', '687878', '869896', '689696', '869878', '667896', '867878', '869698', '887898', '669678', '667676', '887696', '869898', '669696', '867698', '889898', '687698', '887876', '869876', '689896', '867876', '689898', '667876', '667898', '669878', '889878', '869676', '667698', '869678', '889698', '867696', '869696', '867678', '687678', '669898', '689676', '887896', '687898', '889876', '887698', '887878', '687676', '669698'): '蹇', ('676987', '896787', '876767', '698789', '678789', '698967', '896789', '678787', '898767', '696787', '698969', '696967', '878769', '696989', '898987', '898967', '896987', '898769', '676967', '698987', '676787', '878989', '898969', '698767', '876967', '678967', '698787', '876969', '698989', '878969', '676989', '878787', '678987', '878987', '896967', '696769', '696767', '898789', '896969', '876769', '878789', '698769', '896767', '696969', '898787', '876987', '676969', '676789', '876989', '878967', '876789', '678769', '696789', '678767', '878767', '898989', '676767', '896769', '696987', '678969', '678989', '676769', '876787', '896989'): '未济', ('679786', '877768', '677968', '897766', '697968', '677766', '679788', '677986', '679966', '879988', '677768', '879768', '897986', '679988', '679968', '897968', '699968', '897966', '697788', '877788', '899966', '897786', '899986', '699966', '899988', '879766', '699768', '899786', '899766', '879986', '697966', '677788', '877968', '697986', '879786', '899768', '679986', '877766', '899968', '699766', '877966', '677966', '679766', '879966', '877986', '697786', '897788', '877988', '697766', '699986', '897988', '697988', '679768', '899788', '879968', '697768', '877786', '699988', '699788', '897768', '879788', '677988', '699786', '677786'): '恒', ('686766', '666788', '888988', '666768', '666988', '866768', '868766', '666986', '686986', '866966', '886988', '668968', '688768', '868768', '668766', '888768', '868788', '688986', '886968', '688968', '888986', '866988', '668768', '666766', '886768', '666966', '888788', '866986', '668788', '688788', '868988', '886986', '686966', '886966', '888968', '668966', '866788', '688966', '668988', '886766', '866786', '666786', '668986', '868786', '866968', '868966', '686988', '686788', '688988', '866766', '886788', '688786', '686768', '888786', '868968', '888766', '686786', '686968', '668786', '868986', '888966', '886786', '688766', '666968'): '豫', ('686998', '666798', '868798', '666976', '666996', '686776', '888776', '888796', '686778', '688976', '688796', '868996', '666776', '886796', '866778', '888778', '668796', '688778', '866978', '666978', '688798', '868796', '868778', '888798', '886798', '668778', '686996', '688996', '886778', '866776', '688776', '668976', '866998', '668996', '686798', '886776', '666998', '668998', '666778', '868998', '866976', '886998', '868978', '686796', '868976', '888976', '668798', '866798', '868776', '688998', '866796', '666796', '888998', '888996', '886996', '688978', '686976', '886978', '668978', '866996', '888978', '668776', '686978', '886976'): '萃', ('696697', '696877', '678899', '878699', '878879', '898879', '878899', '876879', '678699', '898877', '876677', '898899', '676899', '896679', '896899', '678697', '698879', '696899', '698897', '878877', '678679', '878679', '676877', '678677', '876877', '678879', '698699', '676879', '878677', '696679', '876679', '698697', '878897', '898679', '876699', '896879', '678897', '696897', '696879', '678877', '676677', '876897', '878697', '698677', '876899', '898699', '896697', '876697', '898677', '676697', '898897', '698679', '696677', '896897', '676699', '676897', '698899', '896877', '896677', '696699', '698877', '898697', '676679', '896699'): '涣', ('697779', '879977', '897799', '899799', '899797', '879997', '679999', '677797', '699777', '899977', '879799', '679779', '679777', '877999', '697979', '877797', '677799', '879779', '877777', '897797', '897777', '677777', '877979', '699797', '899779', '877779', '677977', '699977', '897997', '699779', '879999', '879777', '879979', '897999', '897779', '899979', '677979', '899999', '697799', '899777', '697777', '877997', '679797', '677997', '699979', '897977', '877799', '879797', '677779', '699799', '679799', '679997', '697999', '677999', '897979', '899997', '697997', '697977', '697797', '679977', '679979', '699997', '877977', '699999'): '姤', ('698988', '898968', '676968', '876788', '878986', '898766', '896786', '896766', '698766', '698986', '696788', '878968', '876966', '898786', '876986', '876766', '878786', '696766', '678786', '696986', '678788', '896966', '676788', '878766', '678966', '876768', '898768', '676768', '896988', '898788', '876786', '698788', '878788', '898988', '696988', '676786', '696768', '878988', '898986', '676986', '676966', '896986', '876968', '678968', '698966', '896968', '696968', '676766', '876988', '896788', '678768', '678766', '878768', '696786', '878966', '696966', '678988', '698786', '678986', '898966', '698768', '896768', '698968', '676988'): '解', ('766786', '966768', '788788', '788988', '786968', '786966', '786986', '966986', '966988', '766966', '988986', '986966', '788786', '986968', '986788', '988788', '768766', '986766', '966966', '786768', '766988', '988766', '968786', '986988', '968986', '788766', '968766', '786786', '768986', '988966', '988768', '786988', '966788', '768966', '788968', '786788', '986786', '988968', '968968', '986986', '988786', '788768', '768768', '968768', '768788', '786766', '968966', '966786', '766968', '766766', '966968', '766788', '766768', '968788', '766986', '788986', '988988', '968988', '966766', '768786', '788966', '768988', '986768', '768968'): '震', ('768776', '766996', '766976', '786976', '966998', '986778', '968976', '766798', '988796', '788796', '986996', '788978', '768998', '786778', '966978', '768996', '966976', '986976', '986998', '768798', '786996', '968776', '766796', '988976', '966778', '766776', '768778', '786998', '786798', '966798', '786776', '986776', '986796', '966796', '968778', '768796', '988798', '786978', '788976', '786796', '968978', '766778', '988998', '968996', '788998', '968798', '766998', '968796', '788776', '988996', '988778', '966996', '986798', '768978', '966776', '766978', '788778', '788996', '986978', '968998', '988776', '788798', '988978', '768976'): '随', ('776796', '796776', '976776', '778978', '778778', '978978', '976978', '978976', '798978', '976796', '976778', '998978', '998796', '796798', '776798', '976996', '776978', '998776', '996996', '998778', '998998', '796998', '778798', '978796', '798798', '798776', '978776', '776778', '998976', '996978', '796976', '778796', '776998', '978996', '996798', '996778', '798796', '776776', '976798', '798976', '996796', '778976', '796996', '978998', '798998', '796778', '798778', '778998', '978778', '776976', '996776', '996998', '998996', '776996', '798996', '998798', '996976', '778996', '976998', '778776', '978798', '976976', '796796', '796978'): '兑', ('777798', '977978', '797798', '799776', '979978', '799998', '999778', '999976', '779978', '979776', '797996', '977996', '997976', '797776', '797998', '799798', '799996', '797778', '799796', '779998', '979996', '777778', '777978', '797976', '979796', '979998', '977778', '999796', '999798', '979778', '997796', '779976', '799976', '997996', '977998', '997978', '997798', '999776', '777998', '997998', '777996', '779778', '779996', '977796', '999978', '979976', '777796', '979798', '799778', '999996', '777976', '799978', '977976', '997778', '999998', '797978', '779798', '777776', '977776', '779796', '997776', '779776', '797796', '977798'): '夬', ('778987', '776967', '996989', '796989', '996967', '976969', '778967', '776769', '976787', '976987', '998989', '998767', '998769', '776789', '776787', '778989', '996969', '998969', '776969', '798787', '978989', '978987', '778787', '798989', '998987', '796967', '978789', '996787', '978787', '798987', '796767', '796769', '778767', '796969', '776767', '996769', '776989', '796987', '796787', '976967', '778769', '778969', '778789', '976789', '998789', '996767', '978767', '976767', '798767', '996789', '798969', '978967', '978769', '776987', '796789', '798789', '998787', '976989', '798967', '996987', '976769', '798769', '998967', '978969'): '睽', ('786697', '786677', '766677', '768677', '786877', '988699', '986897', '788899', '766899', '966877', '788677', '768897', '768879', '766699', '986899', '986877', '966879', '966699', '966899', '988897', '766897', '788679', '786699', '788699', '968679', '786899', '966897', '966677', '768899', '786679', '966697', '988899', '988877', '988879', '968897', '768877', '786879', '766697', '968677', '766879', '768697', '968899', '988697', '986699', '988679', '766877', '986677', '786897', '788697', '986879', '768679', '788877', '766679', '968699', '986679', '968697', '788897', '968879', '788879', '986697', '768699', '988677', '966679', '968877'): '益', ('787888', '967688', '787886', '767688', '787686', '967666', '969688', '767868', '987888', '789666', '787688', '989666', '967888', '787666', '789866', '787868', '769888', '969866', '769666', '789886', '969668', '767666', '769686', '789688', '969868', '967686', '969686', '767668', '769688', '987686', '769668', '989688', '967886', '989866', '989686', '989668', '767686', '989868', '769866', '989886', '789888', '987868', '789868', '769886', '769868', '969888', '987866', '969886', '967868', '787866', '989888', '969666', '967866', '987688', '767886', '987666', '767866', '987886', '767888', '789686', '789668', '987668', '967668', '787668'): '明夷', ('788989', '966967', '986969', '966969', '786769', '768769', '988769', '788967', '986787', '968967', '786767', '988967', '986767', '766769', '966767', '786989', '766969', '968969', '986789', '988989', '988787', '966769', '966789', '986987', '766989', '788769', '786969', '968787', '768787', '988767', '768967', '768987', '788787', '786987', '988789', '786789', '768969', '966989', '986967', '968767', '788789', '788767', '968769', '786787', '988969', '988987', '786967', '768767', '766967', '968789', '788969', '766787', '768789', '788987', '766767', '768989', '966987', '986769', '968989', '968987', '966787', '766987', '766789', '986989'): '噬嗑', ('789796', '989778', '767798', '767976', '767996', '789798', '967778', '967996', '969998', '967976', '769978', '969776', '789996', '969796', '769998', '987798', '767776', '789976', '787976', '787778', '789778', '787996', '989776', '987976', '989978', '767778', '769776', '987998', '789776', '789998', '969798', '787776', '987978', '769996', '787978', '969978', '787998', '767796', '967978', '769778', '989796', '987996', '787798', '967776', '967798', '987796', '989996', '989976', '989798', '767998', '969778', '969996', '987778', '967796', '967998', '769796', '787796', '769798', '989998', '769976', '969976', '767978', '789978', '987776'): '革', ('797799', '999779', '997797', '779977', '797977', '979999', '979997', '777977', '979779', '779777', '977999', '777777', '977979', '777979', '777997', '799797', '799977', '799799', '997779', '999997', '997777', '997979', '979977', '799999', '999999', '779799', '799997', '979979', '779779', '997997', '997799', '977777', '977779', '777999', '797979', '777779', '997999', '977797', '797999', '999777', '779999', '779979', '977799', '797997', '997977', '799979', '779797', '797777', '779997', '979777', '999979', '799779', '977997', '999799', '777797', '799777', '999797', '979797', '777799', '999977', '797779', '979799', '977977', '797797'): '乾', ('798687', '978689', '976689', '998669', '796867', '776889', '776687', '976687', '778867', '996869', '976887', '796889', '796869', '998867', '776689', '978667', '776869', '798869', '776667', '996867', '978867', '996669', '798887', '776867', '978889', '776669', '976889', '798667', '796689', '798889', '976669', '778887', '798669', '998887', '998687', '976869', '976667', '998869', '798689', '778687', '978887', '996889', '796887', '998667', '778689', '978669', '996687', '998889', '778669', '996689', '996887', '996667', '776887', '998689', '796667', '978869', '798867', '978687', '796687', '976867', '796669', '778869', '778889', '778667'): '损', ('799989', '997989', '779787', '779967', '779769', '979987', '799967', '997969', '797787', '777787', '977989', '999989', '977987', '779989', '999767', '777989', '999787', '799789', '997787', '777789', '777767', '777769', '779987', '997967', '799767', '779789', '797989', '777969', '979969', '977967', '799987', '979769', '979989', '799787', '779969', '799769', '777987', '797967', '979787', '999969', '979767', '779767', '997769', '997767', '977789', '797969', '999789', '797769', '997789', '797789', '799969', '999769', '997987', '797987', '977969', '999987', '977787', '999967', '977769', '979967', '977767', '979789', '777967', '797767'): '大有', ('866679', '888877', '868877', '888879', '688677', '886897', '888697', '666897', '866877', '686697', '668697', '686699', '686897', '686879', '868697', '866699', '666679', '686677', '868679', '686899', '666677', '668899', '886699', '668879', '666899', '886677', '868897', '886679', '668897', '668677', '666699', '886697', '688699', '668877', '888897', '866899', '688879', '686877', '868899', '666697', '888677', '666879', '886899', '886879', '688697', '888899', '866677', '666877', '688877', '868879', '668679', '866897', '688679', '688899', '886877', '868677', '686679', '866697', '688897', '888699', '868699', '866879', '668699', '888679'): '观', ('867669', '689667', '687689', '667869', '867889', '689867', '669669', '867869', '867667', '867887', '667867', '687667', '869887', '689889', '889687', '689687', '689689', '869689', '669689', '667687', '669667', '869667', '887687', '867689', '689869', '687887', '887887', '669867', '687687', '669869', '889667', '669887', '889869', '869687', '687869', '867687', '889889', '669687', '869869', '887689', '887869', '667689', '667669', '667889', '889887', '889689', '687867', '889669', '887889', '869867', '669889', '687889', '887667', '667887', '869669', '887867', '689669', '889867', '869889', '887669', '687669', '867867', '667667', '689887'): '艮', ('868887', '866869', '886889', '866687', '686869', '666687', '668867', '666867', '886869', '686689', '888887', '888669', '668887', '888869', '886867', '888867', '688889', '868889', '868689', '868667', '686687', '868869', '688687', '866689', '666669', '886687', '666869', '866889', '886887', '888889', '686667', '868867', '666667', '888689', '888687', '866669', '668869', '666887', '668669', '868669', '686669', '688887', '686887', '686867', '686889', '666889', '688689', '888667', '668687', '688867', '866867', '668689', '666689', '688669', '668667', '668889', '866667', '866887', '868687', '688869', '886669', '886667', '886689', '688667'): '剥', ('868979', '686999', '688797', '688779', '888979', '666999', '688777', '868999', '686997', '688999', '886979', '666797', '866779', '888797', '686977', '686797', '868797', '866799', '666799', '866977', '866979', '686779', '688997', '888997', '886779', '668779', '866797', '686979', '666979', '688979', '888779', '666977', '866999', '886999', '888999', '886977', '668799', '886799', '868779', '688977', '866777', '666997', '668977', '868799', '688799', '886997', '886797', '888799', '868777', '686777', '666779', '886777', '868997', '668999', '668797', '668979', '668997', '888777', '666777', '888977', '668777', '866997', '686799', '868977'): '否', ('869868', '869866', '689688', '867668', '889668', '689886', '689666', '667888', '669888', '869688', '887666', '669668', '687688', '887668', '889888', '867888', '889666', '887886', '667668', '867886', '889868', '687866', '667666', '887888', '869888', '687668', '867866', '869686', '687686', '669666', '887866', '669868', '889886', '667886', '869668', '669688', '687868', '669686', '689866', '867688', '869886', '667688', '689868', '667686', '687886', '689888', '867686', '889686', '687666', '667868', '687888', '889688', '887868', '689686', '669886', '689668', '887686', '889866', '869666', '669866', '867666', '867868', '887688', '667866'): '谦', ('869989', '869787', '667789', '889787', '889967', '887989', '669987', '687987', '887967', '867967', '867987', '869789', '867767', '869987', '887787', '667767', '887969', '887769', '667787', '867787', '869767', '867969', '867789', '889989', '689989', '689789', '687989', '667967', '689987', '667769', '687787', '687969', '689967', '669767', '887767', '869769', '669789', '887789', '669769', '667989', '687967', '687767', '889987', '669989', '689769', '687789', '869969', '867989', '669787', '889769', '887987', '669969', '667969', '867769', '889767', '687769', '689969', '667987', '889789', '689767', '689787', '669967', '889969', '869967'): '旅', ('876978', '698776', '876996', '878796', '898978', '876776', '678778', '878998', '676976', '696976', '696996', '898798', '676978', '678976', '896996', '898998', '878776', '898976', '896976', '676796', '896798', '696978', '698996', '898776', '876976', '878996', '678978', '676776', '698778', '696798', '696776', '678776', '676998', '896978', '898778', '676798', '678998', '878976', '876998', '678996', '676778', '696778', '696796', '698796', '896796', '696998', '896776', '878978', '876778', '876796', '896998', '878798', '898996', '678798', '878778', '698798', '698998', '698978', '898796', '876798', '678796', '698976', '676996', '896778'): '困', ('877787', '677789', '697767', '699769', '697969', '899967', '699767', '899987', '677969', '677767', '679967', '899989', '897789', '879969', '677967', '899789', '897769', '677989', '877989', '679987', '699787', '697789', '879787', '877789', '897787', '879989', '879987', '679989', '897967', '877969', '699989', '679789', '877987', '879967', '679767', '699789', '899769', '679769', '897767', '877767', '699967', '697769', '897969', '679969', '897989', '899767', '677769', '677787', '879767', '877769', '699969', '677987', '679787', '897987', '697787', '697989', '879789', '899969', '899787', '697987', '697967', '877967', '879769', '699987'): '鼎', ('877877', '877677', '699879', '697697', '699877', '879677', '697699', '899877', '699679', '677699', '879679', '679899', '879699', '897697', '679677', '877897', '879697', '877879', '677697', '677877', '877697', '699899', '879897', '897679', '679897', '699699', '899699', '897699', '897897', '899679', '677897', '877679', '897899', '677679', '699697', '697877', '877899', '897877', '899899', '677677', '897879', '899697', '897677', '677899', '679679', '679877', '679697', '679879', '697679', '899879', '699677', '879877', '879899', '697677', '697879', '877699', '679699', '697899', '677879', '699897', '899677', '697897', '899897', '879879'): '巽', ('878878', '696876', '678876', '696898', '876676', '678878', '876678', '878678', '696896', '896698', '876878', '896678', '676676', '676898', '698696', '898896', '698878', '878676', '876898', '898678', '878898', '898696', '878896', '878696', '676896', '676698', '696696', '678698', '696676', '878876', '698876', '698676', '876698', '898876', '676678', '698898', '678898', '676696', '896898', '878698', '698896', '876876', '696678', '696698', '898676', '678696', '898878', '698698', '678676', '678678', '896676', '678896', '898898', '876696', '896878', '696878', '876896', '676878', '896896', '698678', '676876', '898698', '896876', '896696'): '坎', ('879887', '677887', '877689', '899887', '877687', '679669', '899669', '679887', '697667', '677689', '877867', '899689', '877667', '697669', '679689', '699867', '897869', '677687', '899867', '877887', '899687', '697887', '879889', '897889', '699887', '677867', '697689', '699889', '877869', '897687', '679687', '697687', '897667', '897887', '677889', '679869', '877889', '879867', '899869', '879689', '899667', '877669', '677667', '697889', '679889', '699669', '679667', '699667', '897867', '697867', '699869', '677669', '897689', '879667', '897669', '879869', '879687', '899889', '697869', '879669', '699687', '699689', '677869', '679867'): '蛊', ('886888', '688868', '666866', '686868', '688866', '666666', '866868', '668868', '668866', '888868', '886668', '868868', '686666', '886866', '688668', '868666', '666868', '686866', '688688', '888888', '668666', '686688', '886868', '866668', '666686', '668668', '888666', '686888', '666886', '868686', '668686', '886886', '888686', '666688', '866888', '866666', '688888', '868886', '686886', '868668', '868866', '868888', '668886', '666888', '886686', '866866', '688666', '686686', '866688', '866886', '866686', '668888', '668688', '886666', '888668', '888866', '686668', '886688', '666668', '688686', '888688', '868688', '888886', '688886'): '坤', ('886987', '666989', '868987', '886969', '668987', '668769', '666967', '868969', '686787', '888767', '666987', '666769', '866789', '868769', '686769', '688787', '888789', '666789', '868989', '888969', '686989', '688769', '868789', '686767', '668787', '886967', '686789', '686969', '866787', '888987', '886769', '866987', '688969', '888787', '866967', '888967', '666969', '666787', '686967', '686987', '688967', '688987', '868967', '668969', '866769', '888769', '688767', '668789', '886787', '886767', '868787', '866969', '866989', '666767', '888989', '866767', '668767', '668967', '886989', '688789', '868767', '886789', '668989', '688989'): '晋', ('887986', '687768', '887768', '887966', '869968', '667968', '689766', '687988', '687968', '689968', '689986', '889968', '889966', '667768', '689966', '687788', '887988', '669988', '669768', '669966', '687766', '887766', '689786', '889786', '669986', '687786', '689768', '889988', '867768', '869988', '889986', '889766', '887786', '867786', '887788', '667988', '689788', '667966', '687966', '867788', '667786', '867988', '889788', '869766', '869786', '667986', '869966', '669766', '689988', '867966', '869788', '669786', '687986', '669788', '867968', '867766', '667788', '667766', '869986', '669968', '887968', '867986', '869768', '889768'): '小过', ('889697', '869679', '889899', '669897', '667697', '867899', '689679', '687899', '687699', '887697', '667899', '869697', '867879', '667877', '689899', '887899', '667677', '689879', '887679', '869677', '669879', '667879', '869879', '867679', '889679', '867677', '889699', '689699', '689697', '867699', '669697', '887699', '687879', '887879', '669899', '667679', '869899', '889897', '669677', '887897', '669679', '869897', '867697', '887877', '869877', '667699', '669699', '689677', '687697', '867877', '687877', '687679', '889879', '689897', '689877', '889877', '669877', '667897', '869699', '887677', '687897', '867897', '889677', '687677'): '渐', ('896666', '676668', '696668', '898666', '696666', '678688', '898868', '878668', '676666', '678886', '898686', '878686', '678666', '896886', '676686', '878888', '696888', '878886', '878866', '696688', '676688', '898866', '696686', '876888', '896688', '676866', '896888', '698868', '876688', '898668', '698686', '898886', '698666', '676888', '876686', '876666', '696866', '698688', '698886', '678888', '676886', '896866', '696868', '876868', '678868', '878688', '696886', '876866', '878666', '698888', '898688', '698668', '896668', '876886', '678866', '678668', '698866', '876668', '898888', '896868', '678686', '676868', '878868', '896686'): '师', ('897698', '877696', '879896', '679678', '677696', '679676', '677698', '699878', '879698', '879898', '679896', '899698', '879676', '697896', '697678', '697878', '897878', '897676', '879678', '699896', '899678', '699698', '679698', '677676', '699676', '877876', '899876', '877678', '877896', '679878', '697698', '897696', '899878', '677896', '697676', '899676', '899898', '897898', '897876', '677878', '699696', '677898', '899896', '877878', '897896', '879696', '877698', '879876', '697696', '677678', '879878', '679876', '677876', '697898', '679898', '877676', '897678', '699898', '899696', '877898', '679696', '697876', '699678', '699876'): '井', ('898799', '696779', '898797', '678797', '676799', '698777', '876799', '676797', '676979', '876979', '876999', '896997', '698977', '876977', '878797', '676977', '678977', '676997', '696777', '878999', '876779', '878799', '878997', '896979', '678997', '698779', '676779', '878977', '698979', '878979', '696979', '896977', '696997', '878779', '876797', '876777', '896797', '678799', '896779', '896777', '698999', '678777', '676999', '698997', '678979', '898777', '698799', '878777', '898997', '696799', '678779', '896799', '898977', '898999', '696977', '696797', '698797', '696999', '898979', '896999', '898779', '876997', '676777', '678999'): '讼', ('898869', '676669', '896687', '678669', '896689', '696687', '678869', '896869', '876687', '676687', '696667', '678889', '676667', '876889', '896669', '676689', '696689', '896667', '878667', '676867', '696867', '878869', '898889', '896887', '678667', '678687', '698689', '698667', '878887', '698887', '898689', '696887', '696889', '698889', '898669', '898667', '876867', '678689', '698669', '898867', '898887', '876887', '696869', '878687', '698687', '878889', '898687', '696669', '876667', '896889', '876669', '876689', '878669', '676887', '678867', '896867', '698867', '878689', '698869', '676869', '878867', '876869', '676889', '678887'): '蒙', ('899666', '879688', '879866', '877688', '697868', '877668', '679686', '897688', '679868', '677668', '897666', '877686', '899868', '879888', '677868', '899668', '699686', '899688', '679888', '877886', '697668', '897668', '699866', '877666', '877888', '699666', '697866', '699688', '697886', '897888', '877866', '897686', '699886', '897886', '879686', '899866', '899888', '879886', '677666', '677888', '697688', '679666', '697888', '679688', '897868', '697666', '879666', '679668', '677866', '679866', '677686', '699868', '899686', '677886', '677688', '899886', '697686', '679886', '879868', '877868', '879668', '699668', '897866', '699888'): '升', ('899976', '699996', '879996', '679776', '677776', '699778', '879978', '697998', '677796', '677798', '677778', '679778', '877776', '877996', '679978', '897776', '877796', '899796', '877798', '897976', '679998', '897998', '697996', '899778', '697776', '697778', '679796', '897796', '877978', '879778', '879798', '699776', '879998', '677976', '897778', '679798', '679996', '699976', '897996', '677996', '699998', '697976', '899776', '899996', '899998', '879976', '677978', '679976', '879776', '899978', '877976', '897798', '877778', '897978', '877998', '697798', '699798', '677998', '699978', '699796', '879796', '697796', '899798', '697978'): '大过', ('966997', '788977', '968777', '786979', '766779', '768777', '788777', '786799', '986997', '986977', '966779', '988797', '766979', '786779', '766977', '786797', '986979', '988999', '766797', '768997', '986797', '988977', '966777', '966979', '786777', '986777', '988997', '788979', '786977', '766777', '768979', '986999', '968799', '786999', '788997', '766997', '988979', '788779', '768797', '788799', '966797', '766999', '988777', '986779', '966799', '766799', '968977', '968979', '968997', '768799', '768999', '988799', '988779', '966999', '786997', '968779', '788797', '968797', '788999', '966977', '986799', '768779', '768977', '968999'): '无妄', ('967969', '987969', '769789', '989989', '987989', '767767', '787787', '767989', '967987', '767789', '969967', '789787', '967787', '967769', '969989', '789967', '789767', '969789', '987789', '789989', '767969', '787789', '987787', '969969', '989789', '787969', '967967', '769769', '767987', '769989', '989987', '769969', '767967', '787767', '989769', '767787', '787987', '969767', '787967', '787769', '987767', '769787', '767769', '969769', '987769', '967789', '989967', '967989', '789969', '787989', '967767', '769767', '987987', '989969', '789789', '769967', '989787', '789987', '969987', '987967', '769987', '789769', '989767', '969787'): '离', ('968867', '768687', '766889', '768689', '966889', '786889', '768669', '788687', '788689', '968889', '988889', '786689', '768887', '988887', '766869', '966669', '988867', '768867', '986687', '968887', '988689', '768869', '988687', '986887', '786887', '968669', '968869', '788887', '786669', '966689', '788867', '986667', '966667', '986689', '788669', '966869', '966887', '968689', '986869', '788667', '766887', '788869', '786869', '988869', '786687', '988669', '766687', '966687', '988667', '786667', '786867', '766689', '986669', '966867', '766667', '968667', '986867', '766867', '788889', '768667', '986889', '768889', '766669', '968687'): '颐', ('969678', '987696', '769896', '969676', '787898', '767698', '987676', '769678', '787678', '787878', '989898', '967678', '769696', '789698', '969696', '767696', '967896', '789896', '789898', '789876', '987878', '987876', '767676', '989676', '767876', '789696', '767896', '767678', '769698', '967878', '769876', '789676', '967698', '769898', '787676', '989896', '989696', '787698', '789678', '987698', '967676', '969878', '987678', '789878', '787876', '769676', '767898', '969896', '989878', '967876', '987898', '767878', '967898', '787896', '769878', '967696', '787696', '969876', '989876', '987896', '969698', '989678', '989698', '969898'): '既济', ('969687', '989869', '787869', '987667', '969889', '967689', '967667', '769889', '987669', '989867', '967687', '769887', '767889', '789687', '969667', '969689', '767887', '987687', '989687', '967669', '969887', '969869', '787867', '989669', '989667', '987867', '767669', '989887', '789887', '967889', '789689', '789669', '967867', '989689', '987889', '787887', '769689', '767689', '987869', '987689', '769669', '787669', '769687', '769867', '789889', '769667', '787687', '787689', '789869', '989889', '767687', '789867', '767869', '767667', '967869', '767867', '967887', '789667', '787667', '769869', '969867', '987887', '969669', '787889'): '贲', ('976788', '998766', '998966', '778766', '998988', '978966', '996966', '998786', '798968', '996968', '976786', '776968', '796968', '976968', '978766', '776988', '976766', '796986', '798766', '798768', '976986', '796766', '798786', '978968', '976988', '998788', '778768', '978788', '796966', '798788', '978986', '798966', '978988', '796788', '798988', '796988', '998986', '776768', '776788', '996788', '998768', '778786', '776766', '996988', '978786', '976768', '978768', '776986', '778988', '776786', '796768', '798986', '976966', '778986', '996786', '996766', '796786', '996768', '998968', '778968', '778966', '778788', '996986', '776966'): '归妹', ('976898', '996896', '798898', '978898', '796898', '776678', '778698', '796676', '798678', '778678', '796876', '996696', '976676', '998676', '978878', '998696', '998698', '798698', '978896', '978678', '798876', '778696', '776898', '776676', '776696', '776876', '798676', '778896', '796696', '996698', '998878', '798878', '998896', '978676', '998678', '796878', '776896', '998898', '996898', '978698', '796678', '996878', '798896', '976876', '978876', '978696', '996876', '778676', '976696', '996676', '778898', '976698', '776698', '798696', '776878', '796896', '778876', '796698', '976678', '976896', '996678', '998876', '778878', '976878'): '节', ('977877', '997699', '977679', '779877', '979899', '777699', '999697', '999877', '997677', '977899', '799677', '999699', '797679', '779697', '979877', '799897', '797697', '979699', '797899', '799699', '777897', '777677', '999879', '997897', '777679', '797699', '779897', '797897', '979897', '799879', '779879', '977897', '979679', '977697', '779677', '797879', '799679', '979677', '979697', '999897', '999677', '777879', '977879', '777899', '999899', '779899', '797877', '777697', '997697', '999679', '777877', '979879', '797677', '799899', '779699', '997899', '779679', '977677', '997879', '799697', '977699', '997679', '997877', '799877'): '小畜', ('978666', '998668', '798668', '998868', '778686', '998888', '778668', '978886', '776868', '976666', '778886', '978888', '996888', '998688', '978686', '796868', '998686', '976866', '776888', '978668', '998666', '776866', '778688', '798688', '978688', '776666', '778888', '796666', '776668', '796888', '996866', '796668', '776886', '796688', '978868', '976686', '976888', '976668', '796886', '798666', '996688', '976688', '976886', '798888', '996666', '798866', '796866', '798686', '998866', '976868', '778868', '778666', '798886', '998886', '776686', '996868', '996668', '776688', '796686', '778866', '996686', '798868', '978866', '996886'): '临', ('978877', '796877', '776899', '776897', '976897', '776877', '998697', '778897', '776879', '978679', '776679', '998679', '798697', '976899', '976877', '976699', '778879', '996899', '996877', '996897', '996677', '998879', '798877', '998897', '978697', '796697', '778699', '996879', '798897', '778677', '778697', '776699', '778877', '796679', '978897', '976879', '976679', '778679', '978677', '798699', '996699', '978899', '796897', '778899', '776677', '998899', '796899', '976677', '796699', '998877', '978879', '798879', '776697', '798679', '996697', '998699', '996679', '978699', '976697', '798899', '798677', '998677', '796879', '796677'): '中孚', ('979698', '799698', '999676', '977696', '999898', '977676', '799676', '779898', '779878', '779678', '799878', '797876', '799896', '979696', '999696', '779696', '797698', '977898', '777878', '799898', '977678', '999876', '997678', '777698', '799696', '799678', '779876', '999896', '797878', '777678', '979878', '979898', '799876', '997676', '979876', '979678', '797896', '977878', '797696', '979676', '997896', '977698', '797898', '999678', '997876', '999878', '779676', '977896', '977876', '777898', '997696', '777676', '777876', '779698', '997698', '797676', '997898', '777896', '997878', '979896', '797678', '777696', '999698', '779896'): '需', ('986898', '788678', '968878', '968898', '966896', '766898', '768676', '768678', '766698', '968698', '988676', '788876', '988896', '786678', '788696', '766876', '966696', '786878', '768876', '968676', '966676', '986878', '786896', '986678', '788676', '768898', '766878', '768698', '986896', '966876', '968896', '966678', '986876', '766678', '986698', '986676', '768896', '766896', '768878', '988876', '766696', '786876', '988898', '766676', '988696', '786698', '788896', '988878', '786696', '788898', '986696', '988678', '988698', '768696', '968876', '968696', '786676', '786898', '788878', '788698', '966878', '966898', '968678', '966698'): '屯', ('987766', '787966', '989966', '967768', '987988', '967966', '989788', '789786', '967988', '989768', '767788', '789966', '767988', '787766', '969788', '967968', '767968', '767986', '767966', '789766', '989968', '769788', '769986', '789768', '789986', '969786', '767766', '787788', '969966', '969968', '789788', '987966', '789968', '769968', '987768', '787768', '989986', '967986', '769786', '969988', '787786', '769966', '987968', '787968', '987788', '969766', '969768', '967786', '767768', '767786', '787986', '769766', '787988', '769988', '989786', '987786', '769768', '987986', '969986', '967766', '967788', '789988', '989766', '989988'): '丰', ('987779', '787997', '789999', '969797', '789979', '967997', '969997', '767777', '987777', '989779', '989797', '989999', '789797', '787999', '989799', '767977', '769979', '989997', '969777', '969799', '769779', '789779', '767779', '987799', '769999', '989777', '967799', '787777', '989979', '989977', '789977', '967777', '987997', '969979', '969779', '987979', '789777', '769799', '767799', '987797', '967797', '987999', '787979', '787799', '967979', '767999', '787977', '789799', '967977', '767979', '769777', '969977', '969999', '769797', '787779', '767997', '769977', '769997', '767797', '787797', '789997', '987977', '967779', '967999'): '同人', ('987899', '969879', '767699', '967877', '967879', '787677', '787899', '769677', '767679', '967699', '969897', '789699', '787699', '787877', '767877', '967697', '787897', '989897', '767899', '769877', '969877', '987677', '769897', '969697', '789899', '987877', '787697', '767697', '769679', '969679', '789679', '967679', '787679', '989899', '989879', '967677', '767897', '987679', '987879', '789697', '969677', '967899', '769697', '767879', '987699', '769699', '969899', '967897', '989679', '989699', '787879', '767677', '969699', '789677', '987697', '769899', '987897', '989697', '789877', '989877', '989677', '789897', '789879', '769879'): '家人', ('988888', '786688', '966886', '968886', '768888', '788866', '768866', '786888', '788886', '966668', '766686', '968866', '986888', '768688', '788668', '786866', '986666', '766868', '988666', '788666', '786886', '966888', '786686', '988688', '988686', '786668', '986688', '968688', '788686', '986866', '966666', '766666', '988886', '988868', '786666', '968888', '766688', '766866', '788688', '968868', '988668', '968668', '988866', '766888', '968686', '968666', '768868', '768668', '768886', '788888', '966866', '768686', '966688', '768666', '986886', '986686', '766668', '766886', '786868', '986868', '986668', '966868', '966686', '788868'): '复', ('996999', '776777', '998779', '798999', '796979', '778777', '778779', '978797', '778999', '978977', '796777', '996797', '778979', '998777', '796997', '998799', '796799', '798977', '978999', '976977', '776779', '798979', '976979', '776997', '778797', '998997', '976999', '976777', '996997', '978997', '776977', '798779', '778799', '778977', '798997', '776999', '976799', '798797', '976779', '996977', '998999', '798777', '978979', '996779', '996979', '776799', '998797', '978799', '796999', '776797', '796977', '976797', '778997', '998979', '776979', '996799', '978777', '978779', '976997', '796797', '798799', '796779', '998977', '996777'): '履', ('999868', '977868', '797886', '977666', '797688', '779688', '797686', '977866', '799668', '797668', '997866', '779666', '797888', '777868', '979868', '979866', '999866', '777888', '999668', '977688', '999686', '999688', '779888', '779868', '799868', '777686', '997888', '979686', '997688', '979886', '779866', '799886', '799688', '777866', '979888', '979666', '799666', '999888', '977886', '799888', '799686', '977668', '779668', '977888', '797666', '799866', '779886', '997686', '979668', '777666', '797868', '977686', '777688', '997668', '777886', '997666', '997868', '797866', '999886', '779686', '979688', '999666', '997886', '777668'): '泰', ('999869', '997687', '999669', '777867', '999667', '997669', '777687', '997667', '779687', '797667', '997889', '999887', '979889', '997887', '797867', '799687', '777669', '999687', '779669', '977887', '797869', '777667', '979689', '797887', '777887', '797687', '779689', '979887', '777689', '979687', '979867', '999889', '797669', '977869', '999689', '977669', '979869', '799887', '977867', '799869', '799867', '797889', '779889', '977889', '977689', '799689', '977667', '779869', '799669', '797689', '777869', '997689', '799889', '779887', '779667', '999867', '979669', '977687', '997869', '779867', '979667', '799667', '777889', '997867'): '大畜', ('999986', '777968', '997986', '799966', '797786', '997966', '779788', '799788', '797986', '979986', '997768', '799986', '799766', '977768', '977788', '777786', '797788', '779968', '797968', '777788', '997786', '779766', '977968', '999788', '777768', '799968', '977786', '997968', '977766', '977986', '979988', '779986', '777766', '979966', '779768', '797988', '977966', '777966', '779988', '999966', '779786', '999768', '799786', '797768', '979968', '777988', '997988', '997766', '979788', '977988', '997788', '799768', '999766', '999988', '979768', '777986', '797966', '979786', '999968', '797766', '979766', '799988', '999786', '779966'): '大壮'}, '易经卦爻详解': {'中孚': {0: '豚鱼吉，利涉大川，利贞。', 1: '初九：虞吉，有他不燕。', 2: '九二：鸣鹤在阴，其子和之，我有好爵，吾与尔靡之。', 3: '六三：得敌，或鼓或罢，或泣或歌。', 4: '六四：月几望，马匹亡，无咎。', 5: '九五：有孚挛如，无咎。', 6: '上九：翰音登于天，贞凶。', 7: '彖︰中孚，柔在内而刚得中。说而巽，孚，乃化邦也。豚鱼吉，信及豚鱼也。利涉大川，乘木舟虚也。中孚以利贞，乃应乎天也。'}, '乾': {0: '乾，本卦。元，亨，利，贞。用九：见群龙无首，吉。', 1: '初九：潜龙，勿用。', 2: '九二：见龙在田，利见大人。', 3: '九三：君子终日乾乾，夕惕若，厉无咎。', 4: '九四：或跃在渊，无咎。', 5: '九五：飞龙在天，利见大人。', 6: '上九：亢龙有悔。', 7: '彖︰大哉乾元，万物资始，乃统天。云行雨施，品物流形，大明终始，六位时成，时乘六龙以御天。乾道变化，各正性命，保合大和，乃利贞。首出庶物，万国咸宁。'}, '井': {0: '改邑不改井，无丧无得，往来井井。汔至，亦未繘井，羸其瓶，凶。', 1: '初六：井泥不食，旧井无禽。', 2: '九二：井谷射鲋，瓮敝漏。', 3: '九三：井渫不食，为我民恻，可用汲，王明，并受其福。', 4: '六四：井甃，无咎。', 5: '九五：井冽，寒泉食。', 6: '上六：井收勿幕，有孚元吉。', 7: '彖︰巽乎水而上水，井；井养而不穷也。改邑不改井，乃以刚中也。汔至亦未繘井，未有功也。羸其瓶，是以凶也。'}, '兑': {0: '亨，利贞。', 1: '初九：和兑，吉。', 2: '九二：孚兑，吉，悔亡。', 3: '六三：来兑，凶。', 4: '九四：商兑，未宁，介疾有喜。', 5: '九五：孚于剥，有厉。', 6: '上六：引兑。', 7: '彖︰兑，说也。刚中而柔外，说以利贞，是以顺乎天而应乎人。说以先民，民忘其劳，说以犯难，民忘其死，说之大，民劝矣哉。'}, '剥': {0: '不利有攸往。', 1: '初六：剥床以足，蔑贞凶。', 2: '六二：剥床以辨，蔑贞凶。', 3: '六三：剥之，无咎。', 4: '六四：剥床以肤，凶。', 5: '六五：贯鱼，以宫人宠，无不利。', 6: '上九：硕果不食，君子得舆，小人剥𪪏。', 7: '彖︰剥，剥也，柔变刚也。不利有攸往，小人长也。顺而止之，观象也。君子尚消息盈虚，天行也。'}, '升': {0: '元亨，用见大人，勿恤，南征吉。', 1: '初六：允升，大吉。', 2: '九二：孚乃利用禴，无咎。', 3: '九三：升虚邑。', 4: '六四：王用亨于岐山，吉无咎。', 5: '六五：贞吉，升阶。', 6: '上六：冥升，利于不息之贞。', 7: '彖︰柔以时升，巽而顺，刚中而应，是以大亨；用见大人，勿恤，有庆也；南征吉，志行也。'}, '同人': {0: '同人于野，亨。 利涉大川，利君子贞。', 1: '初九：同人于门，无咎。', 2: '六二：同人于宗，吝。', 3: '九三：伏戎于莽，升其高陵，三岁不兴。', 4: '九四：乘其墉，弗克攻，吉。', 5: '九五：同人，先号啕而后笑。 大师克相遇。', 6: '上九：同人于郊，无悔。', 7: '彖︰同人，柔得位得中而应乎乾，曰同人。同人曰，同人于野，亨，利涉大川，乾行也。文明以健，中正而应，君子正也，唯君子为能通天下之志。'}, '否': {0: '否之匪人，不利君子贞，大往小来。', 1: '初六：拔茅茹，以其夤，贞吉亨。', 2: '六二：包承。 小人吉，大人否亨。', 3: '六三：包羞。', 4: '九四：有命无咎，畴离祉。', 5: '九五：休否，大人吉。 其亡其亡，系于苞桑。', 6: '上九：倾否，先否后喜。', 7: '彖︰否之匪人，不利君子贞，大往小来，则是天地不交而万物不通也，上下不交而天下无邦也。内阴而外阳，内柔而外刚，内小人而外君子。小人道长，君子道消也。'}, '咸': {0: '亨，利贞，取女吉。', 1: '初六：咸其拇。', 2: '六二：咸其腓，凶，居吉。', 3: '九三：咸其股，执其随，往吝。', 4: '九四：贞吉悔亡，憧憧往来，朋从尔思。', 5: '九五：咸其脢，无悔。', 6: '上六：咸其辅，颊，舌。', 7: '彖︰咸，感也。柔上而刚下，二气感应以相与，止而说，男下女，是以亨，利贞，取女吉也。天地感而万物化生，圣人感人心而天下和平。观其所感，而天地万物之情可见矣。'}, '噬嗑': {0: '亨。 利用狱。', 1: '初九：履校灭趾，无咎。', 2: '六二：噬肤灭鼻，无咎。', 3: '六三：噬腊肉，遇毒﹔小吝，无咎。', 4: '九四：噬乾胏，得金矢，利艰贞，吉。', 5: '六五：噬乾肉，得黄金，贞厉，无咎。', 6: '上九：何校灭耳，凶。', 7: '彖︰颐中有物，曰噬嗑，噬嗑而亨。刚柔分，动而明，雷电合而章。柔得中而上行，虽不当位，利用狱也。'}, '困': {0: '亨，贞，大人吉，无咎，有言不信。', 1: '初六：臀困于株木，入于幽谷，三岁不见。', 2: '九二：困于酒食，朱绂方来，利用亨祀，征凶，无咎。', 3: '六三：困于石，据于蒺藜，入于其宫，不见其妻，凶。', 4: '九四：来徐徐，困于金车，吝，有终。', 5: '九五：劓刖，困于赤绂，乃徐有说，利用祭祀。', 6: '上六：困于葛藟，于臲卼，曰动悔。 有悔，征吉。', 7: '彖︰困，刚揜也。险以说，困而不失其所亨，其唯君子乎。贞大人吉，以刚中也；有言不信，尚口乃穷也。'}, '坎': {0: '习坎，有孚，维心亨，行有尚。', 1: '初六：习坎，入于坎窞，凶。', 2: '九二：坎有险，求小得。', 3: '六三：来之坎坎，险且枕，入于坎窞，勿用。', 4: '六四：樽酒簋贰，用缶，纳约自牖，终无咎。', 5: '九五：坎不盈，只既平，无咎。', 6: '上六：系用徽𬙊，置于丛棘，三岁不得，凶。', 7: '彖︰习坎，重险也。水流而不盈，行险而不失其信。维心亨，乃以刚中也。行有尚，往有功也。天险不可升也，地险山川丘陵也，王公设险以守其国，坎之时用大矣哉！'}, '坤': {0: '坤，元，亨，利牝马之贞。君子有攸往，先迷后得主，利西南得朋，东北丧朋。 安贞，吉。用六：利永贞。', 1: '初六：履霜，坚冰至。', 2: '六二：直，方，大，不习无不利。', 3: '六三：含章可贞。 或从王事，无成有终。', 4: '六四：括囊﹔无咎，无誉。', 5: '六五：黄裳，元吉。', 6: '上六：龙𢧐于野，其血玄黄。', 7: '彖︰至哉坤元，万物资生，乃顺承天。坤厚载物，德合无疆，含弘光大，品物咸亨。牝马地类，行地无疆，柔顺利贞。君子攸行，先迷失道，后顺得常。西南得朋，乃与类行。东北丧朋，乃终有庆。安贞之吉，应地无疆。'}, '大壮': {0: '利贞。', 1: '初九：壮于趾，征凶，有孚。', 2: '九二：贞吉。', 3: '九三：小人用壮，君子用罔，贞厉。 羝羊触藩，羸其角。', 4: '九四：贞吉悔亡，藩决不羸，壮于大舆之輹。', 5: '六五：丧羊于易，无悔。', 6: '上六：羝羊触藩，不能退，不能遂，无攸利，艰则吉。', 7: '彖︰大壮，大者壮也。刚以动，故壮。大壮利贞；大者正也。正大而天地之情可见矣！'}, '大有': {0: '元亨。', 1: '初九：无交害，匪咎，艰则无咎。', 2: '九二：大车以载，有攸往，无咎。', 3: '九三：公用亨于天子，小人弗克。', 4: '九四：匪其彭，无咎。', 5: '六五：厥孚交如，威如﹔吉。', 6: '上九：自天佑之，吉无不利。', 7: '彖︰大有，柔得尊位，大中而上下应之，曰大有。其德刚健而文明，应乎天而时行，是以元亨。'}, '大畜': {0: '利贞，不家食吉，利涉大川。', 1: '初九：有厉利已。', 2: '九二：舆说辐。', 3: '九三：良马逐，利艰贞。 曰閑舆卫，利有攸往。', 4: '六四：童牛之牿，元吉。', 5: '六五：豮豕之牙，吉。', 6: '上九：何天之衢，亨。', 7: '彖︰大畜，刚健笃实辉光，日新其德，刚上而尚贤。能止健，大正也。不家食吉，养贤也。利涉大川，应乎天也。'}, '大过': {0: '栋桡，利有攸往，亨。', 1: '初六：藉用白茅，无咎。', 2: '九二：枯杨生稊，老夫得其女妻，无不利。', 3: '九三：栋桡，凶。', 4: '九四：栋隆，吉﹔有它吝。', 5: '九五：枯杨生华，老妇得士夫，无咎无誉。', 6: '上六：过涉灭顶，凶，无咎。', 7: '彖︰大过，大者过也。栋桡，本末弱也。刚过而中，巽而说行，利有攸往，乃亨，大过之时大矣哉。'}, '夬': {0: '扬于王庭，孚号，有厉，告自邑，不利即戎，利有攸往。', 1: '初九：壮于前趾，往不胜为咎。', 2: '九二：惕号，莫夜有戎，勿恤。', 3: '九三：壮于頄，有凶。 君子夬夬，独行遇雨，若濡有愠，无咎。', 4: '九四：臀无肤，其行次且。 牵羊悔亡，闻言不信。', 5: '九五：苋陆夬夬，中行无咎。', 6: '上六：无号，终有凶。', 7: '彖︰夬，决也，刚决柔也。健而说，决而和，扬于王庭，柔乘五刚也。孚号有厉，其危乃光也。告自邑，不利即戎，所尚乃穷也。利有攸往，刚长乃终也。'}, '姤': {0: '女壮，勿用取女。', 1: '初六：系于金柅，贞吉，有攸往，见凶，羸豕孚踟躅。', 2: '九二：包有鱼，无咎，不利宾。', 3: '九三：臀无肤，其行次且，厉，无大咎。', 4: '九四：包无鱼，起凶。', 5: '九五：以杞包瓜，含章，有陨自天。', 6: '上九：姤 其角，吝，无咎。', 7: '彖︰姤，遇也，柔遇刚也。勿用取女，不可与长也。天地相遇，品物咸章也；刚遇中正，天下大行也，姤之时义大矣哉。'}, '家人': {0: '利女贞。', 1: '初九：閑有家，悔亡。', 2: '六二：无攸遂，在中馈，贞吉。', 3: '九三：家人嗃嗃，悔厉吉﹔妇子嘻嘻，终吝。', 4: '六四：富家，大吉。', 5: '九五：王假有家，勿恤吉。', 6: '上九：有孚威如，终吉。', 7: '彖︰家人，女正位乎内，男正位乎外，男女正，天地之大义也。家人有严君焉，父母之谓也。父父，子子，兄兄，弟弟，夫夫，妇妇，而家道正；正家而天下定矣。'}, '小畜': {0: '亨。 密云不雨，自我西郊。', 1: '初九：复自道，何其咎，吉。', 2: '九二：牵复，吉。', 3: '九三：舆说辐，夫妻反目。', 4: '六四：有孚，血去惕出，无咎。', 5: '九五：有孚挛如，富以其邻。', 6: '上九：既雨既处，尚德载，妇贞厉。 月几望，君子征凶。', 7: '彖︰小畜，柔得位，而上下应之，曰小畜。健而巽，刚中而志行，乃亨。密云不雨，尚往也。自我西郊，施未行也。'}, '小过': {0: '亨，利贞，可小事，不可大事。飞鸟遗之音，不宜上宜下，大吉。', 1: '初六：飞鸟以凶。', 2: '六二：过其祖，遇其妣；不及其君，遇其臣；无咎。', 3: '九三：弗过防之，从或戕之，凶。', 4: '九四：无咎，弗过遇之。 往厉必戒，勿用永贞。', 5: '六五：密云不雨，自我西郊，公弋取彼在穴。', 6: '上六：弗遇过之，飞鸟离之，凶，是谓灾眚。', 7: '彖︰小过，小者过而亨也。过以利贞，与时行也。柔得中，是以小事吉也。刚失位而不中，是以不可大事也。有飞鸟之象焉，有飞鸟遗之音，不宜上宜下，大吉；上逆而下顺也。'}, '履': {0: '履虎尾，不咥人，亨。', 1: '初九：素履，往无咎。', 2: '九二：履道坦坦，幽人贞吉。', 3: '六三：眇能视，跛能履，履虎尾，咥人，凶。 武人为于大君。', 4: '九四：履虎尾，愬愬终吉。', 5: '九五：夬履，贞厉。', 6: '上九：视履考祥，其旋元吉。', 7: '彖︰履，柔履刚也。说而应乎乾，是以履虎尾，不咥人，亨。刚中正，履帝位而不疚，光明也。'}, '屯': {0: '元，亨，利，贞，勿用，有攸往，利建侯。', 1: '初九：磐桓﹔利居贞，利建侯。', 2: '六二：屯如邅如，乘马班如。 匪寇婚媾，女子贞不字，十年乃字。', 3: '六三：既鹿无虞，惟入于林中，君子几不如舍，往吝。', 4: '六四：乘马班如，求婚媾，无不利。', 5: '九五：屯其膏，小贞吉，大贞凶。', 6: '上六：乘马班如，泣血涟如。', 7: '彖︰屯，刚柔始交而难生，动乎险中，大亨贞。雷雨之动满盈，天造草昧，宜建侯而不宁。'}, '巽': {0: '小亨，利攸往，利见大人。', 1: '初六：进退，利武人之贞。', 2: '九二：巽在床下，用史巫纷若，吉无咎。', 3: '九三：频巽，吝。', 4: '六四：悔亡，田获三品。', 5: '九五：贞吉悔亡，无不利。 无初有终，先庚三日，后庚三日，吉。', 6: '上九：巽在床下，丧其资斧，贞凶。', 7: '彖︰重巽以申命，刚巽乎中正而志行。柔皆顺乎刚，是以小亨，利有攸往，利见大人。'}, '师': {0: '贞，丈人，吉无咎。', 1: '初六：师出以律，否臧凶。', 2: '九二：在师中，吉无咎，王三锡命。', 3: '六三：师或舆尸，凶。', 4: '六四：师左次，无咎。', 5: '六五：田有禽，利执言，无咎。长子帅师，弟子舆尸，贞凶。', 6: '上六：大君有命，𫔭国承家，小人勿用。', 7: '彖︰师，眾也，贞正也，能以眾正，可以王矣。刚中而应，行险而顺，以此毒天下，而民从之，吉又何咎矣。'}, '复': {0: '亨。 出入无疾，朋来无咎。 反复其道，七日来复，利有攸往。', 1: '初九：不复远，无只悔，元吉。', 2: '六二：休复，吉。', 3: '六三：频复，厉无咎。', 4: '六四：中行独复。', 5: '六五：敦复，无悔。', 6: '上六：迷复，凶，有灾眚。用行师，终有大败，以其国君凶﹔至于十年不克征。', 7: '彖︰复，亨。刚反，动而以顺行，是以出入无疾，朋来无咎。反复其道，七日来复，天行也。利有攸往，刚长也。复，其见天地之心乎。'}, '恒': {0: '亨，无咎，利贞，利有攸往。', 1: '初六：浚恒，贞凶，无攸利。', 2: '九二：悔亡。', 3: '九三：不恒其德，或承之羞，贞吝。', 4: '九四：田无禽。', 5: '六五：恒其德，贞，妇人吉，夫子凶。', 6: '上六：振恒，凶。', 7: '彖︰恒，久也。刚上而柔下，雷风相与，巽而动，刚柔皆应，恒。恒亨无咎，利贞；久于其道也，天地之道，恒久而不已也。利有攸往，终则有始也。日月得天，而能久照，四时变化，而能久成，圣人久于其道，而天下化成；观其所恒，而天地万物之情可见矣！'}, '损': {0: '有孚，元吉，无咎，可贞，利有攸往。曷之用，二簋可用享。', 1: '初九：已事遄往，无咎，酌损之。', 2: '九二：利贞，征凶，弗损益之。', 3: '六三：三人行，则损一人；一人行，则得其友。', 4: '六四：损其疾，使遄有喜，无咎。', 5: '六五：或益之，十朋之龟弗克违，元吉。', 6: '上九：弗损益之，无咎，贞吉，利有攸往，得臣无家。', 7: '彖︰损，损下益上，其道上行。损而有孚，元吉，无咎，可贞，利有攸往。曷之用？二簋可用享；二簋应有时。损刚益柔有时，损益盈虚，与时偕行。'}, '旅': {0: '小亨，旅贞吉。', 1: '初六：旅琐琐，斯其所取灾。', 2: '六二：旅即次，怀其资，得童仆贞。', 3: '九三：旅焚其次，丧其童仆，贞厉。', 4: '九四：旅于处，得其资斧，我心不快。', 5: '六五：射雉一矢亡，终以誉命。', 6: '上九：鸟焚其巢，旅人先笑后号啕。 丧牛于易，凶。', 7: '彖︰旅，小亨，柔得中乎外，而顺乎刚，止而丽乎明，是以小亨，旅贞吉也。旅之时义大矣哉！'}, '既济': {0: '亨，小利贞，初吉终乱。', 1: '初九：曳其轮，濡其尾，无咎。', 2: '六二：妇丧其茀，勿逐，七日得。', 3: '九三：高宗伐鬼方，三年克之，小人勿用。', 4: '六四：𦈡有衣袽，终日戒。', 5: '九五：东邻杀牛，不如西邻之禴祭，实受其福。', 6: '上六：濡其首，厉。', 7: '彖︰既济，亨，小者亨也。利贞，刚柔正而位当也。初吉，柔得中也。终止则乱，其道穷也。'}, '明夷': {0: '利艰贞。', 1: '初九：明夷于飞，垂其翼。 君子于行，三日不食， 有攸往，主人有言。', 2: '六二：明夷，夷于左股，用拯马壮，吉。', 3: '九三：明夷于南狩，得其大首，不可疾贞。', 4: '六四：入于左腹，获明夷之心，出于门庭。', 5: '六五：箕子之明夷，利贞。', 6: '上六：不明晦，初登于天，后入于地。', 7: '彖︰明入地中，明夷。内文明而外柔顺，以蒙大难，文王以之。利艰贞，晦其明也。内难而能正其志，箕子以之。'}, '晋': {0: '康侯用锡马蕃庶，昼日三接。', 1: '初六：晋如，摧如，贞吉。 罔孚，裕无咎。', 2: '六二：晋如，愁如，贞吉。 受兹介福，于其王母。', 3: '六三：眾允，悔亡。', 4: '九四：晋如硕鼠，贞厉。', 5: '六五：悔亡，失得勿恤，往吉无不利。', 6: '上九：晋其角，维用伐邑，厉吉无咎，贞吝。', 7: '彖︰晋，进也。明出地上，顺而丽乎大明，柔进而上行。是以康侯用锡马蕃庶，昼日三接也。'}, '未济': {0: '亨，小狐汔济，濡其尾，无攸利。', 1: '初六：濡其尾，吝。', 2: '九二：曳其轮，贞吉。', 3: '六三：未济，征凶，利涉大川。', 4: '九四：贞吉，悔亡，震用伐鬼方，三年有赏于大国。', 5: '六五：贞吉，无悔，君子之光，有孚，吉。', 6: '上九：有孚于饮酒，无咎，濡其首，有孚失是。', 7: '彖︰未济，亨；柔得中也。小狐汔济，未出中也。濡其尾，无攸利；不续终也。虽不当位，刚柔应也。'}, '归妹': {0: '征凶，无攸利。', 1: '初九：归妹以娣，跛能履，征吉。', 2: '九二：眇能视，利幽人之贞。', 3: '六三：归妹以须，反归以娣。', 4: '九四：归妹愆期，迟归有时。', 5: '六五：帝乙归妹，其君之袂，不如其娣之袂良，月几望，吉。', 6: '上六：女承筐无实，士刲羊无血，无攸利。', 7: '彖︰归妹，天地之大义也。天地不交，而万物不兴，归妹人之终始也。说以动，所归妹也。征凶，位不当也。无攸利，柔乘刚也。'}, '比': {0: '吉。 原筮元永贞，无咎。 不宁方来，后夫凶。', 1: '初六：有孚比之，无咎。 有孚盈缶，终来有他，吉。', 2: '六二：比之自内，贞吉。', 3: '六三：比之匪人。', 4: '六四：外比之，贞吉。', 5: '九五：显比，王用三驱，失前禽。 邑人不戒，吉。', 6: '上六：比之无首，凶。', 7: '彖︰比，吉也，比，辅也，下顺从也。原筮元永贞，无咎，以刚中也。不宁方来，上下应也。后夫凶，其道穷也。'}, '泰': {0: '小往大来，吉亨。', 1: '初九：拔茅茹，以其夤，征吉。', 2: '九二：包荒，用冯河，不遐遗，朋亡，得尚于中行。', 3: '九三：无平不陂，无往不复，艰贞无咎。 勿恤其孚，于食有福。', 4: '六四：翩翩不富，以其邻，不戒以孚。', 5: '六五：帝乙归妹，以祉元吉。', 6: '上六：城复于隍，勿用师。 自邑告命，贞吝。', 7: '彖︰泰，小往大来，吉亨，则是天地交而万物通也，上下交而其志同也。内阳而外阴，内健而外顺，内君子而外小人。君子道长，小人道消也。'}, '涣': {0: '亨。 王假有庙，利涉大川，利贞。', 1: '初六：用拯马壮，吉。', 2: '九二：涣奔其机，悔亡。', 3: '六三：涣其躬，无悔。', 4: '六四：涣其群，元吉。 涣有丘，匪夷所思。', 5: '九五：涣汗其大号，涣王居，无咎。', 6: '上九：涣其血，去逖出，无咎。', 7: '彖︰涣，亨。刚来而不穷，柔得位乎外而上同。王假有庙，王乃在中也。利涉大川，乘木有功也。'}, '渐': {0: '女归吉，利贞。', 1: '初六：鸿渐于干，小子厉，有言，无咎。', 2: '六二：鸿渐于磐，饮食衎衎，吉。', 3: '九三：鸿渐于陆，夫征不复，妇孕不育，凶；利御寇。', 4: '六四：鸿渐于木，或得其桷，无咎。', 5: '九五：鸿渐于陵，妇三岁不孕，终莫之胜，吉。', 6: '上九：鸿渐于逵，其羽可用为仪，吉。', 7: '彖︰渐之进也，女归吉也。进得位，往有功也。进以正，可以正邦也。其位刚，得中也。止而巽，动不穷也。'}, '无妄': {0: '元，亨，利，贞。 其匪正有眚，不利有攸往。', 1: '初九：无妄，往吉。', 2: '六二：不耕获，不菑畬，则利有攸往。', 3: '六三：无妄之灾，或系之牛，行人之得，邑人之灾。', 4: '九四：可贞，无咎。', 5: '九五：无妄之疾，勿药有喜。', 6: '上九：无妄，行有眚，无攸利。', 7: '彖︰无妄，刚自外来而为主于内，动而健，刚中而应，大亨以正，天之命也，其匪正有眚，不利有攸往。无妄之往，何之矣。天命不祐，行矣哉。'}, '益': {0: '利有攸往，利涉大川。', 1: '初九：利用为大作，元吉，无咎。', 2: '六二：或益之，十朋之龟弗克违，永贞吉。 王用享于帝，吉。', 3: '六三：益之用凶事，无咎。 有孚中行，告公用圭。', 4: '六四：中行，告公从。 利用为依迁国。', 5: '九五：有孚惠心，勿问元吉。 有孚惠我德。', 6: '上九：莫益之，或击之，立心勿恒，凶。', 7: '彖︰益，损上益下，民说无疆，自上下下，其道大光。利有攸往，中正有庆。利涉大川，木道乃行。益动而巽，日进无疆。天施地生，其益无方。凡益之道，与时偕行。'}, '睽': {0: '小事吉。', 1: '初九：悔亡，丧马勿逐，自复﹔见恶人无咎。', 2: '九二：遇主于巷，无咎。', 3: '六三：见舆曳，其牛掣，其人天且劓，无初有终。', 4: '九四：睽孤，遇元夫，交孚，厉无咎。', 5: '六五：悔亡，厥宗噬肤，往何咎。', 6: '上九：睽孤， 见豕负涂，载鬼一车， 先张之弧，后说之弧，匪寇婚媾，往遇雨则吉。', 7: '彖︰睽，火动而上，泽动而下；二女同居，其志不同行；说而丽乎明，柔进而上行，得中而应乎刚；是以小事吉。天地睽，而其事同也；男女睽，而其志通也；万物睽，而其事类也；睽之时用大矣哉！'}, '节': {0: '亨。 苦节不可贞。', 1: '初九：不出户庭，无咎。', 2: '九二：不出门庭，凶。', 3: '六三：不节若，则嗟若，无咎。', 4: '六四：安节，亨。', 5: '九五：甘节，吉﹔往有尚。', 6: '上六：苦节，贞凶，悔亡。', 7: '彖︰节，亨，刚柔分，而刚得中。苦节不可贞，其道穷也。说以行险，当位以节，中正以通。天地节而四时成，节以制度，不伤财，不害民。'}, '临': {0: '元，亨，利，贞。 至于八月有凶。', 1: '初九：咸临，贞吉。', 2: '九二：咸临，吉无不利。', 3: '六三：甘临，无攸利。 既忧之，无咎。', 4: '六四：至临，无咎。', 5: '六五：知临，大君之宜，吉。', 6: '上六：敦临，吉无咎。', 7: '彖︰临，刚浸而长，说而顺，刚中而应，大亨以正，天之道也。至于八月有凶，消不久也。'}, '艮': {0: '艮其背，不获其身，行其庭，不见其人，无咎。', 1: '初六：艮其趾，无咎，利永贞。', 2: '六二：艮其腓，不拯其随，其心不快。', 3: '九三：艮其限，列其夤，厉薰心。', 4: '六四：艮其身，无咎。', 5: '六五：艮其辅，言有序，悔亡。', 6: '上九：敦艮，吉。', 7: '彖︰艮，止也。时止则止，时行则行，动静不失其时，其道光明。艮其止，止其所也。上下敌应，不相与也。是以不获其身，行其庭不见其人，无咎也。'}, '萃': {0: '亨。 王假有庙，利见大人，亨，利贞。 用大牲吉，利有攸往。', 1: '初六：有孚不终，乃乱乃萃，若号一握为笑，勿恤，往无咎。', 2: '六二：引吉，无咎，孚乃利用禴。', 3: '六三：萃如，嗟如，无攸利，往无咎，小吝。', 4: '九四：大吉，无咎。', 5: '九五：萃有位，无咎。 匪孚，元永贞，悔亡。', 6: '上六：赍咨涕洟，无咎。', 7: '彖︰萃，聚也。顺以说，刚中而应，故聚也。王假有庙，致孝享也；利见大人，亨，聚以正也；用大牲，吉，利有攸往，顺天命也。观其所聚，而天地万物之情可见矣。'}, '蒙': {0: '亨。 匪我求童蒙，童蒙求我。 初噬告，再三渎，渎则不告。利贞。', 1: '初六：发蒙，利用刑人，用说桎梏，以往吝。', 2: '九二：包蒙吉，纳妇吉，子克家。', 3: '六三：勿用娶女，见金夫，不有躬，无攸利。', 4: '六四：困蒙，吝。', 5: '六五：童蒙，吉。', 6: '上九：击蒙，不利为寇，利御寇。', 7: '彖︰蒙，山下有险，险而止，蒙。蒙亨，以亨行时中也。匪我求童蒙，童蒙求我，志应也。初噬告，以刚中也。再三渎，渎则不告，渎蒙也。蒙以养正，圣功也。'}, '蛊': {0: '元亨，利涉大川。 先甲三日，后甲三日。', 1: '初六：干父之蛊，有子考无咎，厉终吉。', 2: '九二：干母之蛊，不可贞。', 3: '九三：干父之蛊，小有悔，无大咎。', 4: '六四：裕父之蛊，往见吝。', 5: '六五：干父之蛊，用誉。', 6: '上九：不事王侯，高尚其事。', 7: '彖︰蛊，刚上而柔下，巽而止，蛊。蛊，元亨，而天下治也。利涉大川，往有事也。先甲三日，后甲三日，终则有始，天行也。'}, '观': {0: '盥而不荐，有孚颙若。', 1: '初六：童观，小人无咎，君子吝。', 2: '六二：窥观，利女贞。', 3: '六三：观我生，进退。', 4: '六四：观国之光，利用宾于王。', 5: '九五：观我生，君子无咎。', 6: '上九：观其生，君子无咎。', 7: '彖︰大观在上，顺而巽，中正以观天下。观，盥而不荐，有孚颙若，下观而化也。观天之神道，而四时不忒，圣人以神道设教，而天下服矣。'}, '解': {0: '利西南，无所往，其来复吉。 有攸往，夙吉。', 1: '初六：无咎。', 2: '九二：田获三狐，得黄矢，贞吉。', 3: '六三：负且乘，致寇至，贞吝。', 4: '九四：解而拇，朋至斯孚。', 5: '六五：君子维有解，吉；有孚于小人。', 6: '上六：公用射隼，于高墉之上，获之，无不利。', 7: '彖︰解，险以动，动而免乎险，解。解利西南，往得眾也。其来复吉，乃得中也。有攸往夙吉，往有功也。天地解，而雷雨作，雷雨作，而百果草木皆甲坼，解之时大矣哉！'}, '讼': {0: '有孚，窒。 惕中吉。 终凶。 利见大人，不利涉大川。', 1: '初六：不永所事，小有言，终吉。', 2: '九二：不克讼，归而逋，其邑人三百户，无眚。', 3: '六三：食旧德，贞厉，终吉，或从王事，无成。', 4: '九四：不克讼，复自命，渝安贞，吉。', 5: '九五：讼元吉。', 6: '上九：或锡之鞶带，终朝三褫之。', 7: '彖︰讼，上刚下险，险而健，讼。讼有孚，窒惕，中吉，刚来而得中也。终凶，讼不可成也。利见大人，尚中正也。不利涉大川，入于渊也。'}, '谦': {0: '亨，君子有终。', 1: '初六：谦谦君子，用涉大川，吉。', 2: '六二，鸣谦，贞吉。', 3: '九三，劳谦，君子有终，吉。', 4: '六四：无不利，㧑谦。', 5: '六五：不富，以其邻，利用侵伐，无不利。', 6: '上六：鸣谦，利用行师，征邑国。', 7: '彖︰谦，亨，天道下济而光明，地道卑而上行。天道亏盈而益谦，地道变盈而流谦，鬼神害盈而福谦，人道恶盈而好谦。谦尊而光，卑而不可踰，君子之终也。'}, '丰': {0: '亨，王假之，勿忧，宜日中。', 1: '初九：遇其配主，虽旬无咎，往有尚。', 2: '六二：丰其蔀，日中见斗，往得疑疾，有孚发若，吉。', 3: '九三：丰其沛，日中见昧，折其右肱，无咎。', 4: '九四：丰其蔀，日中见斗，遇其夷主，吉。', 5: '六五：来章，有庆誉，吉。', 6: '上六：丰其屋，蔀其家，窥其户，阒其无人，三岁不见，凶。', 7: '彖︰丰，大也。明以动，故丰。王假之，尚大也。勿忧宜日中，宜照天下也。日中则昃，月盈则食，天地盈虚，与时消息，而况人于人乎？况于鬼神乎？'}, '豫': {0: '利建侯行师。', 1: '初六：鸣豫，凶。', 2: '六二：介于石，不终日，贞吉。', 3: '六三：盱豫，悔。 迟有悔。', 4: '九四：由豫，大有得。勿疑。 朋盍簪。', 5: '六五：贞疾，恒不死。', 6: '上六：冥豫，成有渝，无咎。', 7: '彖︰豫，刚应而志行，顺以动，豫。豫，顺以动，故天地如之，而况建侯行师乎？天地以顺动，故日月不过，而四时不忒；圣人以顺动，则刑罚清而民服。豫之时义大矣哉！'}, '贲': {0: '亨。 小利有所往。', 1: '初九：贲其趾，舍车而徒。', 2: '六二：贲其须。', 3: '九三：贲如濡如，永贞吉。', 4: '六四：贲如皤如，白马翰如，匪寇婚媾。', 5: '六五：贲于丘园，束帛戋戋，吝，终吉。', 6: '上九：白贲，无咎。', 7: '彖︰贲，亨；柔来而文刚，故亨。分刚上而文柔，故小利有攸往。天文也；文明以止，人文也。观乎天文，以察时变；观乎人文，以化成天下。'}, '蹇': {0: '利西南，不利东北；利见大人，贞吉。', 1: '初六：往蹇，来誉。', 2: '六二：王臣蹇蹇，匪躬之故。', 3: '九三：往蹇来反。', 4: '六四：往蹇来连。', 5: '九五：大蹇朋来。', 6: '上六：往蹇来硕，吉；利见大人。', 7: '彖︰蹇，难也，险在前也。见险而能止，知矣哉！蹇利西南，往得中也；不利东北，其道穷也。利见大人，往有功也。当位贞吉，以正邦也。蹇之时用大矣哉！'}, '遯': {0: '亨，小利贞。', 1: '初六：遯尾，厉，勿用有攸往。', 2: '六二：执之用黄牛之革，莫之胜说。', 3: '九三：系遯，有疾厉，畜臣妾吉。', 4: '九四：好遯君子吉，小人否。', 5: '九五：嘉遯，贞吉。', 6: '上九：肥遯，无不利。', 7: '彖︰遯亨，遯而亨也。刚当位而应，与时行也。小利贞，浸而长也。遯之时义大矣哉。'}, '随': {0: '元亨利贞，无咎。', 1: '初九：官有渝，贞吉。 出门交有功。', 2: '六二：系小子，失丈夫。', 3: '六三：系丈夫，失小子， 随有求得，利居贞。', 4: '九四：随有获，贞凶，有孚在道，以明，何咎。', 5: '九五：孚于嘉，吉。', 6: '上六：拘系之，乃从维之。 王用亨于西山。', 7: '彖︰随，刚来而下柔，动而说，随。大亨贞，无咎，而天下随时，随时之义大矣哉！'}, '离': {0: '利贞，亨。 畜牝牛，吉。', 1: '初九：履错然，敬之无咎。', 2: '六二：黄离，元吉。', 3: '九三：日昃之离，不鼓缶而歌，则大耋之嗟，凶。', 4: '九四：突如其来如，焚如，死如，弃如。', 5: '六五：出涕沱若，戚嗟若，吉。', 6: '上九：王用出征，有嘉折首，获其匪丑，无咎。', 7: '彖︰离，丽也；日月丽乎天，百穀草木丽乎土，重明以丽乎正，乃化成天下。柔丽乎中正，故亨；是以畜牝牛吉也。'}, '需': {0: '有孚，光亨，贞吉。 利涉大川。', 1: '初九：需于郊。 利用恒，无咎。', 2: '九二：需于沙。 小有言，终吉。', 3: '九三：需于泥，致寇至。', 4: '六四：需于血，出自穴。', 5: '九五：需于酒食，贞吉。', 6: '上六：入于穴，有不速之客三人来，敬之终吉。', 7: '彖︰需，须也；险在前也。刚健而不陷，其义不困穷矣。需有孚，光亨，贞吉。位乎天位，以正中也。利涉大川，往有功也。'}, '震': {0: '亨。 震来虩虩，笑言哑哑。 震惊百里，不丧匕鬯。', 1: '初九：震来虩虩，后笑言哑哑，吉。', 2: '六二：震来厉，亿丧贝，跻于九陵，勿逐，七日得。', 3: '六三：震苏苏，震行无眚。', 4: '九四：震遂泥。', 5: '六五：震往来厉，亿无丧，有事。', 6: '上六：震索索，视矍矍，征凶。 震不于其躬，于其邻，无咎。 婚媾有言。', 7: '彖︰震，亨。震来虩虩，恐致福也。笑言哑哑，后有则也。震惊百里，惊远而惧迩也。出可以守宗庙社稷，以为祭主也'}, '革': {0: '巳日乃孚，元亨利贞，悔亡。', 1: '初九：巩用黄牛之革。', 2: '六二：巳日乃革之，征吉，无咎。', 3: '九三：征凶，贞厉，革言三就，有孚。', 4: '九四：悔亡，有孚改命，吉。', 5: '九五：大人虎变，未占有孚。', 6: '上六：君子豹变，小人革面，征凶，居贞吉。', 7: '彖︰革，水火相息，二女同居，其志不相得，曰革。巳日乃孚；革而信也。文明以说，大亨以正，革而当，其悔乃亡。天地革而四时成，汤武革命，顺乎天而应乎人，革之时大矣哉！'}, '颐': {0: '贞吉。观颐，自求口实。', 1: '初九：舍尔灵龟，观我朵颐，凶。', 2: '六二：颠颐，拂经，与丘颐，征凶。', 3: '六三：拂颐，贞凶，十年勿用，无攸利。', 4: '六四：颠颐吉，虎视眈眈，其欲逐逐，无咎。', 5: '六五：拂经，居贞吉，不可涉大川。', 6: '上九：由颐，厉吉，利涉大川。', 7: '彖︰颐贞吉，养正则吉也。观颐，观其所养也；自求口实，观其自养也。天地养万物，圣人养贤，以及万民；颐之时大矣哉！'}, '鼎': {0: '元吉，亨。', 1: '初六：鼎颠趾，利出否，得妾以其子，无咎。', 2: '九二：鼎有实，我仇有疾，不我能即，吉。', 3: '九三：鼎耳革，其行塞，雉膏不食，方雨亏悔，终吉。', 4: '九四：鼎折足，覆公𫗧，其形渥，凶。', 5: '六五：鼎黄耳金铉，利贞。', 6: '上九：鼎玉铉，大吉，无不利。', 7: '彖︰鼎，象也。以木巽火，亨饪也。圣人亨以享上帝，而大亨以养圣贤。巽而耳目聪明，柔进而上行，得中而应乎刚，是以元亨。'}}, '月建': ['甲子', '庚午', '辛未', '壬申', '癸酉', '甲戌', '己卯', '戊寅', '丙子', '丁丑', '戊寅', '己卯', '庚辰', '辛巳', '丙戌', '乙酉', '戊寅', '甲申', '乙酉', '丙戌', '丁亥', '戊子', '癸巳', '壬辰', '庚寅', '辛卯', '壬辰', '癸巳', '甲午', '乙未', '庚子', '己亥', '甲午', '乙未', '丙申', '丁酉', '戊戌', '己亥', '甲辰', '癸卯', '辛丑', '壬寅', '癸卯', '甲辰', '乙巳', '丙午', '辛亥', '庚戌', '戊申', '己酉', '庚戌', '辛亥', '壬子', '癸丑', '戊午', '丁巳', '乙卯', '丙辰', '戊寅', '戊午', '己未', '庚申', '乙丑', '甲子'], '积算': ['己巳', '乙亥', '丙子', '丁丑', '戊寅', '己卯', '甲申', '癸未', '辛巳', '壬午', '癸未', '甲申', '乙酉', '丙戌', '辛卯', '庚寅', '癸未', '己丑', '庚寅', '辛卯', '壬辰', '癸巳', '戊戌', '丁酉', '庚寅', '丙申', '丁酉', '戊戌', '己亥', '庚子', '乙巳', '甲辰', '己亥', '庚子', '辛丑', '壬寅', '癸卯', '甲辰', '己酉', '戊申', '丙午', '丁未', '戊申', '己酉', '庚戌', '辛亥', '丙辰', '乙卯', '癸丑', '甲寅', '乙卯', '丙辰', '丁巳', '戊午', '癸亥', '壬戌', '庚申', '辛酉', '癸未', '癸亥', '甲子', '乙丑', '庚午', '己巳']}
jieqi_name = re.findall('..', '春分清明谷雨立夏小满芒种夏至小暑大暑立秋处暑白露秋分寒露霜降立冬小雪大雪冬至小寒大寒立春雨水惊蛰')


def multi_key_dict_get(d, k):
    for keys, v in d.items():
        if k in keys:
            return v
    return None


def new_list(olist, o):
    a = olist.index(o)
    res1 = olist[a:] + olist[:a]
    return res1


def ecliptic_lon(jd_utc):
    s = Sun(jd_utc)
    equ = Equatorial(s.ra, s.dec, epoch=jd_utc)
    e = Ecliptic(equ)
    return e.lon


def sta(jd):
    e = ecliptic_lon(jd)
    n = int(e * 180.0 / math.pi / 15)
    return n


def iteration(jd, sta):
    s1 = sta(jd)
    s0 = s1
    dt = 1.0
    while True:
        jd += dt
        s = sta(jd)
        if s0 != s:
            s0 = s
            dt = -dt / 2
        if abs(dt) < 0.0000001 and s != s1:
            break
    return jd


def change(year, month, day, hour, minute):
    changets = Date(
        "{}/{}/{} {}:{}:00".format(str(year).zfill(4), str(month).zfill(2), str(day).zfill(2), str(hour).zfill(2),
                                   str(minute).zfill(2)))
    return Date(changets - 24 * ephem.hour * 30)


def jq(year, month, day, hour, minute):  # 从当前时间开始连续输出未来n个节气的时间
    # current =  datetime.strptime("{}/{}/{} {}:{}:00".format(str(year).zfill(4), str(month).zfill(2), str(day).zfill(2),str(hour).zfill(2), str(minute).zfill(2)), '%Y/%m/%d %H:%M:%S')
    current = Date(
        "{}/{}/{} {}:{}:00".format(str(year).zfill(4), str(month).zfill(2), str(day).zfill(2), str(hour).zfill(2),
                                   str(minute).zfill(2)))
    jd = change(year, month, day, hour, minute)
    # jd = Date("{}/{}/{} {}:{}:00.00".format(str(b.year).zfill(4), str(b.month).zfill(2), str(b.day).zfill(2), str(b.hour).zfill(2), str(b.minute).zfill(2)  ))
    result = []
    e = ecliptic_lon(jd)
    n = int(e * 180.0 / math.pi / 15) + 1
    for i in range(3):
        if n >= 24:
            n -= 24
        jd = iteration(jd, sta)
        d = Date(jd + 1 / 3).tuple()
        dt = Date("{}/{}/{} {}:{}:00.00".format(d[0], d[1], d[2], d[3], d[4]).split(".")[0])
        time_info = {dt: jieqi_name[n]}
        n += 1
        result.append(time_info)
    j = [list(i.keys())[0] for i in result]
    if current > j[0] and current > j[1] and current > j[2]:
        return list(result[2].values())[0]
    if current > j[0] and current > j[1] and current <= j[2]:
        return list(result[1].values())[0]
    if current >= j[1] and current < j[2]:
        return list(result[1].values())[0]
    if current < j[1] and current < j[2]:
        return list(result[0].values())[0]


def gong_wangzhuai(j_q):
    wangzhuai = list("旺相胎没死囚休废")
    # wangzhuai_num = [3,4,9,2,7,6,1,8]
    wangzhuai_num = list("震巽离坤兑乾坎艮")
    wangzhuai_jieqi = {('春分', '清明', '谷雨'): '春分',
                       ('立夏', '小满', '芒种'): '立夏',
                       ('夏至', '小暑', '大暑'): '夏至',
                       ('立秋', '处暑', '白露'): '立秋',
                       ('秋分', '寒露', '霜降'): '秋分',
                       ('立冬', '小雪', '大雪'): '立冬',
                       ('冬至', '小寒', '大寒'): '冬至',
                       ('立春', '雨水', '惊蛰'): '立春'}
    r1 = dict(zip(new_list(wangzhuai_num,
                           dict(zip(jieqi_name[0::3], wangzhuai_num)).get(multi_key_dict_get(wangzhuai_jieqi, j_q))),
                  wangzhuai))
    r2 = {v: k for k, v in r1.items()}
    return r1, r2

acquire_num_dict= {
    "四七六二九": "乾卦，潜龙勿用。",
    "四八三九八": "乾卦，见龙在田利见大人",
    "四九一六七": "乾卦，君子终日乾乾夕惕若厉无咎",
    "三六一一二": "乾卦，或跃在渊无咎",
    "四三七九三": "乾卦，飞龙在天",
    "五一四七四": "乾卦，亢龙有悔",
    "一四七八九": "坤卦，履霜坚冰至",
    "一五四六二": "坤卦，直方大不习无不利",
    "一六一三五": "坤卦，含章可贞或从王事无成有终",
    "二八九Ｏ四": "坤卦，括囊无咎无誉",
    "三五六二五": "坤卦，黄裳元吉",
    "四二三四六": "坤卦，龙𢧐于野其血玄黄",
    "二二五三三": "屯卦，元亨利贞勿用有攸往利建侯",
    "二二五三三": "屯卦，磐桓利居贞利建侯",
    "二三二三八": "屯卦，乘马班如屯如邅如匪寇婚媾女子贞不字十年乃字",
    "二三九四三": "屯卦，即鹿无虞惟入于林中君子几不如舍往吝",
    "二九五七六": "屯卦，乘马班如求婚媾往吉无不利",
    "三六六一七": "屯卦，屯其膏小贞吉大贞凶",
    "四三六五八": "屯卦，乘马班如泣血涟如",
    "Ｏ八四五八": "蒙卦，发蒙利用刑人用说桎梏以往吝",
    "Ｏ九一六三": "蒙卦，包蒙吉纳妇吉子克家",
    "Ｏ九八六八": "蒙卦，勿用取女见金夫不有躬无攸利",
    "三四五Ｏ九": "蒙卦，困蒙吝",
    "四一五五Ｏ": "蒙卦，童蒙吉",
    "四八五九一": "蒙卦，击蒙不利为寇利御寇",
    "四五六四Ｏ": "需卦，需于郊利用恒无咎",
    "四六三七七": "需卦，需于沙小有言终吉",
    "四七一一四": "需卦，需于泥致寇至",
    "三Ｏ九二三": "需卦，需于血出自穴",
    "三八二八四": "需卦，需于酒食贞吉",
    "四五六四五": "需卦，入于穴有不速之客三人来敬之无咎",
    "Ｏ八八四Ｏ": "讼卦，不永所事小有言终吉",
    "Ｏ九五七七": "讼卦，不克讼归而逋邑人三百户无眚",
    "二Ｏ三一四": "讼卦，食旧德贞厉终吉或从王事无成",
    "一四六Ｏ三": "讼卦，不克讼复即命渝安贞吉",
    "一九六四Ｏ": "讼卦，讼元吉",
    "四九三二五": "讼卦，或锡之鞶带终朝三褫之",
    "Ｏ八二六Ｏ": "师卦，师出以律否臧凶",
    "Ｏ八九四九": "师卦，在师中吉无咎王三锡命",
    "Ｏ九六三八": "师卦，师或舆尸凶",
    "二九五九一": "师卦，师左次无咎",
    "三六四七二": "师卦，田有禽利执言无咎长子帅师",
    "四二三五三": "师卦，大君有命𫔭国承家小人勿用",
    "一五一四Ｏ": "比卦，有孚比之无咎有孚盈缶终来有他吉",
    "一五八二九": "比卦，比之自内贞吉",
    "一六五一八": "比卦，比之匪人",
    "一八九Ｏ三": "比卦，外比之贞吉",
    "三五七八四": "比卦，显比王用三驱失前禽邑人不诫吉",
    "四二六六五": "比卦，比之无首凶",
    "四六六三五": "小畜卦，复自道何其咎吉",
    "四七三八八": "小畜卦，牵复吉",
    "四八一四一": "小畜卦，舆说辐夫妻反目",
    "三三八Ｏ九": "小畜卦，有孚血出惕",
    "四一三七Ｏ": "小畜卦，有孚挛如富以其邻",
    "四八八九一": "小畜卦，既雨既处尚德载妇贞厉月几望君子征凶",
    "五四一五八": "履卦，素履往无咎",
    "五四九一一": "履卦，履道坦坦",
    "五五六六四": "履卦，眇能视跛能履履虎尾咥人凶",
    "三五三六一": "履卦，履虎尾愬愬终吉",
    "四二八八二": "履卦，夬履贞厉",
    "五Ｏ四Ｏ三": "履卦，视履考祥其旋元吉",
    "四四六四九": "泰卦，拔茅茹以其彙征吉",
    "四五三七Ｏ": "泰卦，包荒用凭河不遐遗朋亡得尚于中行",
    "四六Ｏ九一": "泰卦，无平不陂无往不复艰贞无咎勿恤其孚于食有福",
    "三Ｏ九七二": "泰卦，翩翩不富以其邻不戒以孚",
    "三八一七三": "泰卦，帝乙归妹以祉元吉",
    "四五三七四": "泰卦，城复于隍勿用师自邑告命贞吝",
    "一五八四九": "否卦，拔茅茹以其彙贞吉亨",
    "一六五七Ｏ": "否卦，包承小人吉大人否亨",
    "一七二九一": "否卦，包羞",
    "二三八五二": "否卦，有命无咎畴离祉",
    "四一Ｏ五三": "否卦，休否大人吉其亡其亡系于包桑",
    "四八二五四": "否卦，倾否先否后吉",
    "六九二ＯＯ": "同人卦，同人于门无咎",
    "六九九五三": "同人卦，同人于宗吝",
    "七Ｏ七Ｏ六": "同人卦，伏戎于莽升其高陵三岁不兴",
    "三五三六三": "同人卦，乘其墉弗克攻吉",
    "四二八八四": "同人卦，同人先号咷而后笑大师克相遇",
    "五Ｏ四Ｏ五": "同人卦，同人于郊无悔",
    "四六六四Ｏ": "大有卦，无交害匪咎艰则无咎",
    "四七三九三": "大有卦，大车以载有攸往无咎",
    "四八一四六": "大有卦，公用亨于天子小人弗克",
    "三七六一九": "大有卦，匪其彭无咎",
    "四五一四Ｏ": "大有卦，厥孚交如威如吉",
    "五二六六一": "大有卦，自天佑之吉无不利",
    "五六四二七": "谦卦，谦谦君子用涉大川吉",
    "五七一一六": "谦卦，鸣谦贞吉",
    "五七八Ｏ五": "谦卦，劳谦君子有终吉",
    "一九五九八": "谦卦，无不利㧑谦",
    "三六四七九": "谦卦，不富以其邻利用侵伐",
    "四三三六Ｏ": "谦卦，鸣谦利用行师征邑国",
    "一五一四二": "豫卦，鸣豫凶",
    "一五八三一": "豫卦，介于石不终日贞吉",
    "一六五ＯＯ": "豫卦，盱豫悔迟有悔",
    "三Ｏ二八一": "豫卦，由豫大有得勿疑朋",
    "三七一六二": "豫卦，贞疾恒不死",
    "四四Ｏ四三": "豫卦，冥豫成有渝",
    "二三Ｏ五一": "随卦，官有渝贞吉出门交有功",
    "二三七七二": "随卦，系小子失丈夫",
    "二四四九三": "随卦，系丈夫失小子随有求得",
    "三四五七四": "随卦，随有获贞凶有孚在道",
    "四一七七五": "随卦，孚于嘉言",
    "四八九七六": "随卦，拘系之乃从维之王用亨于西山",
    "三Ｏ二五三": "蛊卦，干父之蛊有子考无咎厉终吉",
    "三Ｏ九七四": "蛊卦，干母之蛊不可贞",
    "三一六九五": "蛊卦，干父之蛊小有悔无大咎",
    "三五二九六": "蛊卦，裕父之蛊往见吝",
    "四二四九七": "蛊卦，干父之蛊用誉",
    "四九六九八": "蛊卦，不事王侯高尚其事",
    "五Ｏ六九八": "临卦，咸临贞吉",
    "五一四Ｏ三": "临卦，咸临吉无不利",
    "五二一Ｏ八": "临卦，甘临无攸利既忧之无咎",
    "三Ｏ二八五": "临卦，至临无咎",
    "三七三二六": "临卦，知临大君之宜吉",
    "四四三六七": "临卦，敦临吉无咎",
    "一五四九五": "观卦，童观小人无咎君子吝",
    "一六二ＯＯ": "观卦，闚观利女贞",
    "一六九Ｏ五": "观卦，观我生进退",
    "三一六九Ｏ": "观卦，观国之光利用宾于王",
    "三八七三一": "观卦，观我生君子无咎",
    "四五七七二": "观卦，观其生君子无咎",
    "二三Ｏ五三": "噬嗑卦，屦校灭趾无咎",
    "二三七七四": "噬嗑卦，噬肤灭鼻无咎",
    "二四四九五": "噬嗑卦，噬腊肉遇毒小吝无咎",
    "三六Ｏ一六": "噬嗑卦，噬乾胏得金矢利艰",
    "四三二一七": "噬嗑卦，噬乾肉得黄金贞厉无咎",
    "五Ｏ四一八": "噬嗑卦，何校灭耳凶",
    "六六二五八": "贲卦，贲其趾舍车而徒",
    "六六九七九": "贲卦，贲其须",
    "六七七ＯＯ": "贲卦，贲如濡如永贞吉",
    "三五三Ｏ一": "贲卦，贲如皤如白马翰如匪寇婚媾",
    "四二五Ｏ二": "贲卦，贲于丘园束帛笺笺吝终吉",
    "四九七Ｏ三": "贲卦，白贲无咎",
    "一五一四七": "剥卦，剥床以足蔑贞凶",
    "一五八三六": "剥卦，剥床以辨蔑贞凶",
    "一六五二五": "剥卦，剥之无咎",
    "三三七二六": "剥卦，剥床以肤凶",
    "四Ｏ六Ｏ七": "剥卦，贯鱼以宫人宠无不利",
    "四七四八八": "剥卦，硕果不食君子得舆小人剥𪪏",
    "二二Ｏ二二": "复卦，不远复无祇悔元吉",
    "二二七一一": "复卦，休复吉",
    "二三四ＯＯ": "复卦，频复厉无咎",
    "二九五九三": "复卦，中行独复",
    "三六四七四": "复卦，敦复无悔",
    "四三三五五": "复卦，迷复凶有灾眚用行师终有大败以其国君凶至于十年不克征",
    "二三五六二": "无妄卦，无妄往吉",
    "二四二九九": "无妄卦，不耕获不菑畲则利有攸往",
    "二五Ｏ三六": "无妄卦，无妄之灾或系之牛行人之得邑人之灾",
    "三四六Ｏ五": "无妄卦，可贞无咎",
    "四一九六六": "无妄卦，无妄之疾勿药有喜",
    "四九三二七": "无妄卦，无妄行有眚无攸利",
    "四五六四七": "大畜卦，有厉利已",
    "四六三八四": "大畜卦，舆说輹",
    "四七一一Ｏ": "大畜卦，良马逐利艰贞曰闲舆卫利有攸往",
    "三六Ｏ八二": "大畜卦，童牛之牿元吉",
    "四三四四二": "大畜卦，豮豕之吉",
    "五Ｏ八Ｏ四": "大畜卦，何天之衢亨",
    "二二五四Ｏ": "颐卦，舍尔灵龟观我朵颐凶",
    "二三二四五": "颐卦，颠颐拂经于丘颐征凶",
    "二三九五Ｏ": "颐卦，拂颐贞凶十年勿用无攸利",
    "三四五一一": "颐卦，颠颐吉虎视耽耽其欲逐逐",
    "四一五五二": "颐卦，颐经居真吉不可涉大川",
    "四八五九三": "颐卦，由颐厉吉利涉大川",
    "三Ｏ九二四": "大过卦，藉用白茅无咎",
    "三一六六一": "大过卦，枯杨生梯老夫得其女妻无不利",
    "三二三九四": "大过卦，栋桡凶",
    "三五三四三": "大过卦，栋隆吉有它吝",
    "四二七Ｏ四": "大过卦，枯杨生华老妇得其士夫无咎无誉",
    "五ＯＯ六五": "大过卦，过涉灭顶凶",
    "Ｏ八四五一": "坎卦，习坎入于坎窞凶",
    "Ｏ九一五一": "坎卦，坎有险求小得",
    "Ｏ九八六六": "坎卦，来之坎坎且枕入于坎窞勿用",
    "二九五七四": "坎卦，樽酒簋贰用缶纳约自牖终无咎",
    "二六六一五": "坎卦，坎不盈祗既平无咎",
    "四三六五六": "坎卦，繫于徽𬙊寘于丛棘三岁不得凶",
    "六七七三一": "离卦，履错然敬之无咎",
    "六八四六八": "离卦，黄离元吉",
    "六九二Ｏ五": "离卦，日昃之离不鼓缶而歌则大耋之嗟凶",
    "三六八二二": "离卦，突如其来如焚如死如弃如",
    "四四一八三": "离卦，出涕沱若戚嗟如吉",
    "五二五四四": "离卦，王用出征有嘉折首获匪其丑无咎",
    "五九Ｏ五六": "咸卦，咸其拇",
    "五九七七七": "咸卦，咸其腓凶居吉",
    "六Ｏ四九八": "咸卦，咸其股执其随往吝",
    "三四五七九": "咸卦，贞吉悔亡憧憧往来朋从尔思",
    "四一七八Ｏ": "咸卦，咸其脢无悔",
    "四八九八一": "咸卦，咸其辅颊舌",
    "三Ｏ二四八": "恒卦，浚恒贞凶无攸利",
    "三Ｏ九六九": "恒卦，悔亡",
    "三一六九Ｏ": "恒卦，不恒其德或承之羞",
    "二一六九一": "恒卦，田无禽",
    "三八八九二": "恒卦，恒其德贞妇人吉天子凶",
    "四六Ｏ九三": "恒卦，振恒凶",
    "六Ｏ三六七": "遯卦，遯尾厉勿用有攸往",
    "六一一Ｏ四": "遯卦，执之用黄牛之革莫之胜说",
    "六一八四一": "遯卦，系遯有疾厉畜臣妾吉",
    "三四六一Ｏ": "遯卦，好遯君子吉小人否",
    "四一九七一": "遯卦，嘉遯贞吉",
    "四九三三二": "遯卦，肥遯无不利",
    "四五六四二": "大壮卦，壮于趾征凶有孚",
    "四六三七九": "大壮卦，贞吉",
    "四七一一六": "大壮卦，小人用壮君子用罔贞厉羝羊触藩羸其角",
    "三二三九七": "大壮卦，贞吉悔凶藩决不嬴壮于大舆之輹",
    "三九七五八": "大壮卦，丧羊于易无悔",
    "四七一一九": "大壮卦，羝羊触藩不能退不能遂无攸利艰则吉",
    "一五五ＯＯ": "晋卦，晋如摧如贞吉",
    "一六二Ｏ五": "晋卦，晋如愁如贞吉受兹介福于其王母",
    "一六九一Ｏ": "晋卦，众允悔亡",
    "三五二一五": "晋卦，晋如鼫鼠贞厉",
    "四二二五六": "晋卦，悔亡失得勿恤往吉无不利",
    "四九二九七": "晋卦，晋其角维用伐邑厉吉无咎",
    "六四七八Ｏ": "明夷卦，明夷于飞垂其翼君子于行三日不食有攸往主人有言",
    "六五四八五": "明夷卦，明夷于左股用拯马壮吉",
    "六六一九Ｏ": "明夷卦，明夷于南狩得其大首不可疾贞",
    "三Ｏ二八七": "明夷卦，入于左腹获明夷之心于出门庭",
    "三七三二八": "明夷卦，箕子之明夷利贞",
    "四四三六九": "明夷卦，不明晦初登于天后入于地",
    "六七七二六": "家人卦，闲有家",
    "六八四六三": "家人卦，遂在中馈贞吉",
    "六九二ＯＯ": "家人卦，家人嗃嗃悔厉吉妇子嘻嘻终吉",
    "三三一三七": "家人卦，富家大吉",
    "四Ｏ四九八": "家人卦，王假有家勿恤吉",
    "四七八五九": "家人卦，有孚威如吉",
    "五三ＯＯ九": "睽卦，悔亡丧马勿逐自复见恶人无咎",
    "五三七四六": "睽卦，遇主于巷无咎",
    "五四四八三": "睽卦，见舆曳其牛掣其人天且劓无初有终",
    "三六八二Ｏ": "睽卦，睽孤遇元夫交孚厉无咎",
    "四四一八一": "睽卦，悔亡厥宗噬肤往何咎",
    "五一五四二": "睽卦，睽孤见豕负涂载鬼一车先张之弧后说之弧匪寇婚媾往遇雨则吉",
    "五七七三八": "蹇卦，往蹇来誉",
    "五八四四三": "蹇卦，王臣蹇蹇匪躬之故",
    "五九一四八": "蹇卦，往蹇来反",
    "二九五八一": "蹇卦，往蹇来连",
    "三六六二二": "蹇卦，大蹇朋来",
    "四三六六三": "蹇卦，往蹇来硕吉利见大人",
    "Ｏ八四五三": "解卦，无咎",
    "Ｏ九一五八": "解卦，田获三狐得黄矢贞吉",
    "Ｏ九八六三": "解卦，负且乘致寇至贞吝",
    "三Ｏ九八四": "解卦，解而拇朋至斯孚",
    "三八Ｏ二五": "解卦，君子维有解吉有孚于小人",
    "四五Ｏ六六": "解卦，公用射隼于高墉之上获之无不利",
    "五一八五六": "损卦，已事遄往无咎酌损之",
    "五二五七七": "损卦，利贞征凶弗损益之",
    "五三二九八": "损卦，三人行则损一人一人行则得其友",
    "三五二九九": "损卦，损其疾使遄有喜无咎",
    "四二五ＯＯ": "损卦，或益之十朋之龟弗克违元吉",
    "四九七Ｏ一": "损卦，弗损之益无咎贞吉利有攸往得臣无家",
    "二三ｏ四八": "益卦，利用为大作元吉无咎",
    "二三七六九": "益卦，或益之十朋之龟弗克违永贞吉王用亨于帝吉",
    "二四四九Ｏ": "益卦，益之用凶事无咎有孚中行告公用圭",
    "三二四一一": "益卦，中行告公从利用为依迁国",
    "三九六一二": "益卦，有孚惠心勿问元吉有孚惠我德",
    "四六八一三": "益卦，或益之勿击之立心勿恒凶",
    "四六六三八": "夬卦，壮于前趾往不胜为咎",
    "四七三九一": "夬卦，惕号莫夜有戎勿恤",
    "四八一四四": "夬卦，壮于頄有凶君子夬夬独行遇雨若濡有愠无咎",
    "三六一一三": "夬卦，臀无肤其行次且牵羊悔亡闻言不信",
    "四三六三四": "夬卦，苋陆夬夬中行无咎",
    "五一一五五": "夬卦，无号终有凶",
    "四六一一六": "姤卦，繫于金柅贞吉有攸往见凶羸豕孚躅踯",
    "三二三四八": "姤卦，包有鱼不利宾",
    "三三一Ｏ一": "姤卦，臀无肤其行次且厉无大咎",
    "三五三五八": "姤卦，包无鱼起凶",
    "四二八七九": "姤卦，以杞包瓜含章有陨自天",
    "五Ｏ四ＯＯ": "姤卦，姤其角吝无咎",
    "一五四九八": "萃卦，有孚不终乃乱乃萃若号一握为咲勿恤往无咎",
    "一六二Ｏ三": "萃卦，引吉无咎孚乃利用禴",
    "一一九Ｏ八": "萃卦，萃如嗟如无攸利往无咎小吝",
    "三三八Ｏ五": "萃卦，大吉无咎",
    "四Ｏ八四六": "萃卦，萃有位无咎匪孚元永贞悔亡",
    "四七八八七": "萃卦，赍咨涕洟无咎",
    "二九五七五": "升卦，允升大吉",
    "三Ｏ二八Ｏ": "升卦，孚乃利用禴无咎",
    "三Ｏ九八五": "升卦，升虚邑",
    "三Ｏ二八二": "升卦，王用享于岐山吉无咎",
    "三七三二二": "升卦，贞吉升阶",
    "四四三六四": "升卦，冥升利于不息之贞",
    "Ｏ八六四九": "困卦，臀困于株木入于幽谷三岁不觌",
    "Ｏ九三七Ｏ": "困卦，困于酒食朱绂方来利用亨贞凶无咎",
    "一ＯＯ九一": "困卦，困于石据于蒺蔾入于其宫不见其妻凶",
    "三四五七二": "困卦，来徐徐困于金车吝有终",
    "四一七七三": "困卦，劓刖困于赤绂乃徐有说利用祭祀",
    "四八九七四": "困卦，困于葛藟于臲卼曰动悔有悔征吉",
    "三Ｏ二四六": "井卦，井泥不食旧井无禽",
    "三Ｏ九六七": "井卦，井谷射鲋瓮敝漏",
    "三一六八八": "井卦，井渫不食为我心恻可用汲王明并受其福",
    "三Ｏ二四九": "井卦，井甃无咎",
    "三七四五Ｏ": "井卦，井洌寒泉食",
    "四四六五一": "井卦，井收勿幕有孚元吉",
    "六七七二九": "革卦，巩用黄牛之革",
    "六八四六六": "革卦，已日乃革之征吉无咎",
    "六九一Ｏ四": "革卦，征凶贞厉革言三就有孚",
    "三五三四八": "革卦，悔亡有孚改命吉",
    "四二七Ｏ九": "革卦，大人虎变未占有孚",
    "五ＯＯ七Ｏ": "革卦，君子豹变小人革面征凶居贞吉",
    "三Ｏ九二六": "鼎卦，鼎颠趾利出否得妾以其子无咎",
    "三一六六三": "鼎卦，鼎有实我仇有疾不我能即吉",
    "三二四ＯＯ": "鼎卦，鼎耳革其行塞雉膏不食方雨亏悔终吉",
    "三六八一七": "鼎卦，鼎折足覆公𫗧其形渥凶",
    "四四一七八": "鼎卦，鼎黄耳金铉利贞",
    "五一五三九": "鼎卦，鼎玉铉大吉无不利",
    "二二五三五": "震卦，震来虩虩后咲言哑哑吉",
    "二三二四Ｏ": "震卦，震来厉亿丧贝跻于九陵勿逐七日得",
    "二三九四五": "震卦，震苏苏震行无眚",
    "三Ｏ九八六": "震卦，震遂泥",
    "三八Ｏ二七": "震卦，震往来厉亿无丧有事",
    "四五Ｏ六八": "震卦，震索索视矍矍征凶震不于其躬于其邻无咎婚媾有言",
    "五七七四五": "艮卦，艮其趾无咎利永贞",
    "五八四五Ｏ": "艮卦，艮其腓不拯其随其心不快",
    "五九一五五": "艮卦，艮其限列其夤厉薰心",
    "三四五一六": "艮卦，艮其身无咎",
    "四一五五七": "艮卦，艮其辅言有序悔亡",
    "四八五九八": "艮卦，敦艮吉",
    "五九Ｏ二三": "渐卦，鸿渐于干小子厉有言无咎",
    "五九七七四": "渐卦，鸿渐于磐饮食衎衎吉",
    "六Ｏ四九五": "渐卦，鸿渐于陆夫征不复妇孕不有凶利御寇",
    "三二四一六": "渐卦，鸿渐于桷无咎",
    "三九六一七": "渐卦，鸿渐于陵妇三岁不孕终莫之胜吉",
    "四六八一八": "渐卦，鸿渐于陆其羽可用为仪吉",
    "五一八五一": "归妹卦，归妹以娣跛能履征吉",
    "五二五七二": "归妹卦，眇能视利幽人贞吉",
    "五三二五三": "归妹卦，归妹以须反归以娣",
    "三一六九四": "归妹卦，归妹愆期迟归有时",
    "三八八九五": "归妹卦，帝乙归妹其君之袂不如其子之袂",
    "四六Ｏ九六": "归妹卦，女承筐无实士刲羊无血",
    "六六二五三": "丰起，遇其配主虽旬无咎往有尚",
    "六六九七四": "丰起，丰其蔀日中见斗往得疑疾有孚发若吉",
    "六七六九五": "丰起，丰其沛日中见沬折其右肱无咎",
    "三一六九六": "丰起，丰其蔀日中见斗遇其夷主吉",
    "三八八九七": "丰起，来章有庆誉吉",
    "四六Ｏ九八": "丰起，丰其屋蔀其家闚其户间其无人",
    "五九Ｏ五八": "旅卦，旅琐琐斯其所取灾",
    "五九七七九": "旅卦，旅即次怀其资得童仆贞厉",
    "六Ｏ五ＯＯ": "旅卦，旅焚其次丧其童仆贞厉",
    "三六Ｏ二一": "旅卦，旅于处得其资斧我心不快",
    "四三二二二": "旅卦，射雉一矢亡终以誉命",
    "五Ｏ四二三": "旅卦，鸟焚其巢旅人先笑后号咷丧牛于易凶",
    "三Ｏ九二一": "巽卦，进退利武人之贞",
    "三一六五八": "巽卦，巽在床下用史巫纷若吉无咎",
    "三二三九五": "巽卦，频巽吝",
    "三三一三二": "巽卦，悔亡田获三品",
    "四Ｏ四九三": "巽卦，贞吉悔亡无不利无初有终先庚三日后庚三日吉",
    "四七八五四": "巽卦，巽在床下丧其资斧贞吉",
    "五二ＯＯ七": "兑卦，和兑吉",
    "五三七四四": "兑卦，孚兑吉悔亡",
    "五四四八一": "兑卦，来兑凶",
    "三五三四六": "兑卦，商兑未宁介疾有喜",
    "四二七Ｏ七": "兑卦，孚于剥有厉",
    "五ＯＯ六八": "兑卦，引兑",
    "Ｏ八六四六": "涣卦，用拯马壮吉",
    "Ｏ九三六七": "涣卦，涣奔其机悔亡",
    "一ＯＯ八八": "涣卦，涣其躬无悔",
    "三二四Ｏ九": "涣卦，涣其群元吉涣有丘匪夷所思",
    "三九六一Ｏ": "涣卦，涣汗其大号涣王居无咎",
    "四六八一一": "涣卦，涣其血去逖出无咎",
    "五一八四九": "节卦，不出户庭无咎",
    "五二五七Ｏ": "节卦，不出门庭凶",
    "五三二九一": "节卦，不节若则嗟若无咎",
    "三Ｏ二五二": "节卦，安节吉",
    "三七四五三": "节卦，甘节吉往有尚",
    "四四六五四": "节卦，苦节贞凶悔亡",
    "五三ＯＯ四": "中孚卦，虞吉有它不燕",
    "五三七四一": "中孚卦，鸣鹤在阴其子和之我有好爵吾与尔靡之",
    "五四四七八": "中孚卦，得敌或鼓或罢或泣或歌",
    "三三一三五": "中孚卦，月几望马匹亡无咎",
    "四Ｏ四九六": "中孚卦，有孚挛如无咎",
    "四七八五七": "中孚卦，翰音登于天贞凶",
    "五七七四Ｏ": "小过卦，飞鸟以凶",
    "五八四四五": "小过卦，过其祖遇其妣不及其君遇其臣无咎",
    "五九一五Ｏ": "小过卦，弗过防之从或戕之凶",
    "三Ｏ九九一": "小过卦，无咎弗过遇之往厉必戒勿用永贞",
    "三八Ｏ三二": "小过卦，密云不雨自我西郊公弋取彼在穴",
    "四五Ｏ七三": "小过卦，弗遇过之飞鸟离之凶是谓灾眚",
    "六六一五一": "既济卦，曳其轮濡其尾无咎",
    "六六九七二": "既济卦，妇丧其茀勿逐七日得",
    "六七六九三": "既济卦，高宗伐鬼方三年克之小人勿用",
    "三Ｏ二五四": "既济卦，𦈡有衣袽终日戒",
    "三七四五五": "既济卦，东邻杀牛不如西邻之禴祭实受其福",
    "四四六五六": "既济卦，濡其首厉",
    "Ｏ八六五一": "未济卦，濡其尾吝",
    "Ｏ九三七二": "未济卦，曳其轮贞吉",
    "一ＯＯ九三": "未济卦，未济贞凶利涉大川",
    "三六Ｏ一四": "未济卦，贞吉悔亡震用伐鬼方三年有赏于大国",
    "四二二一五": "未济卦，贞吉悔亡君子之光有孚吉",
    "五Ｏ四一六": "未济卦，有孚于饮酒无咎濡其首有孚失是"
}

# %% 甲子平支
def jiazi():
    return list(map(lambda x: "{}{}".format(tian_gan[x % len(tian_gan)], di_zhi[x % len(di_zhi)]), list(range(60))))


def repeat_list(n, thelist):
    return [repetition for i in thelist for repetition in repeat(i, n)]


class Iching():
    # 64卦、4096种卦爻組合資料庫，爻由底(左)至上(右)起
    def __init__(self):
        self.data = base_data
        self.sixtyfourgua = self.data.get("数字排六十四卦")
        self.sixtyfourgua_description = self.data.get("易经卦爻详解")
        self.eightgua = self.data.get("八卦数值")
        self.eightgua_element = self.data.get("八卦卦象")
        self.bagua_pure_code = self.data.get("八宫卦纯卦")
        self.tiangan = self.data.get("干")
        self.dizhi = self.data.get("支")
        self.wuxin = self.data.get("五行")
        self.down = self.data.get("下卦数")
        self.up = self.data.get("上卦数")
        self.gua = self.data.get("八卦")
        self.shen = self.data.get("世身")
        self.sixtyfour_gua_index = self.data.get("六十四卦")
        self.shiying2 = self.data.get("世应排法")
        self.findshiying = dict(zip(list(self.data.get("八宫卦").values()), self.shiying2))
        self.liuqin = self.data.get("六亲")
        self.liuqin_w = self.data.get("六亲五行")
        self.mons = self.data.get("六兽")
        self.chin_list = self.data.get("二十八宿")
        self.gua_down_code = dict(zip(self.gua, self.down))
        self.gua_up_code = dict(zip(self.gua, self.up))
        self.ymc = [11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
        self.rmc = list(range(1, 32))
        # 旬

    def shun(self, gz):
        shun_value = dict(zip(self.Zhi, list(range(1, 13)))).get(gz[1]) - dict(zip(self.Gan, list(range(1, 11)))).get(
            gz[0])
        if shun_value < 0:
            shun_value = shun_value + 12
        return {0: "戊", 10: "己", 8: "庚", 6: "辛", 4: "壬", 2: "癸"}.get(shun_value)

    def find_shier_luck(self, gan):
        return {**dict(zip(self.tiangan[0::2], list(
            map(lambda y: dict(zip(y, re.findall('..', "长生沐浴冠带临官帝旺衰　病　死　墓　绝　胎　养　"))),
                list(map(lambda i: self.new_list(self.dizhi, i), list("亥寅寅巳申"))))))), **dict(
            zip(self.tiangan[1::2],
                [dict(zip(y, re.findall('..', "死　病　衰　帝旺临官冠带沐浴长生养　胎　绝　墓　"))) for y in
                 list(map(lambda i: self.new_list(self.dizhi, i), list("亥寅寅巳申")))]))}.get(gan)

    # 日空时空
    def daykong_shikong(self, year, month, day, hour, minute):
        guxu = {'甲子': {'孤': '戌亥', '虛': '辰巳'}, '甲戌': {'孤': '申酉', '虛': '寅卯'},
                '甲申': {'孤': '午未', '虛': '子丑'}, '甲午': {'孤': '辰巳', '虛': '戌亥'},
                '甲辰': {'孤': '寅卯', '虛': '申酉'}, '甲寅': {'孤': '子丑', '虛': '午未'}}
        return {"日空": self.multi_key_dict_get(guxu, self.multi_key_dict_get(self.liujiashun_dict(),
                                                                              self.gangzhi(year, month, day, hour,
                                                                                           minute)[2])).get("孤"),
                "时空": self.multi_key_dict_get(guxu, self.multi_key_dict_get(self.liujiashun_dict(),
                                                                              self.gangzhi(year, month, day, hour,
                                                                                           minute)[3])).get("孤")}

    def liujiashun_dict(self):
        return dict(zip(list(
            map(lambda x: tuple(x), list(map(lambda x: self.new_list(self.jiazi(), x)[0:10], self.jiazi()[0::10])))),
                        self.jiazi()[0::10]))

    def new_list(self, olist, o):
        zhihead_code = olist.index(o)
        res1 = []
        for i in range(len(olist)):
            res1.append(olist[zhihead_code % len(olist)])
            zhihead_code = zhihead_code + 1
        return res1

    def chin_iter(self, olist, chin):
        new_chin_list = self.new_list(olist, chin)
        return itertools.cycle(new_chin_list)

    def upper_lowergua_code(self, gua1, gua2):
        gua_dict = dict(zip(list("乾兑离震巽坎艮坤"), [126, 132, 138, 144, 150, 156, 162, 168]))
        return gua_dict.get(gua1) + gua_dict.get(gua2)

    def four_gz_code(self, ygz, mgz, dgz, hgz):
        jiazi_code = dict(zip(self.jiazi(),
                              [112, 190, 34, 56, 75, 91, 107, 217, 249, 190, 248, 303, 35, 61, 107, 116, 94, 136, 112,
                               293, 228, 177, 135, 122, 62, 49, 129, 120, 202, 91, 119, 177, 131, 86, 225, 169, 83, 105,
                               158, 249, 109, 98, 57, 187, 222, 95, 266, 135, 105, 183, 137, 228, 98, 83, 70, 171, 99,
                               101, 249, 296]))
        return jiazi_code.get(ygz) + jiazi_code.get(mgz) + jiazi_code.get(dgz) + jiazi_code.get(hgz)

    def count_yy(self, ygz, mgz, dgz, hgz):
        fourgz = [ygz[1], mgz[1], dgz[1], hgz[1]]
        zhi_count = {tuple(list("子,寅,辰,未,酉,亥")): "老", tuple(list("午,申,戌,丑,卯,巳")): "少"}
        countfour = [self.multi_key_dict_get(zhi_count, i) for i in fourgz]
        if countfour.count("老") > countfour.count("少"):
            result = 720
        if countfour.count("少") > countfour.count("老"):
            result = 360
        if countfour.count("少") == countfour.count("老"):
            result = 720
        return result

    def guaike(self, year, month, day, hour, minute, gua1, gua2):
        gz = self.gangzhi(year, month, day, hour, minute)
        ygz = gz[0]
        mgz = gz[1]
        dgz = gz[2]
        hgz = gz[3]
        gua_code = dict(zip(list(range(0, 11)), list("艮艮兑坎离震巽巽坤乾")))
        two_gua = self.upper_lowergua_code(gua1, gua2)
        fgz = self.four_gz_code(ygz, mgz, dgz, hgz)
        laoshao = self.count_yy(ygz, mgz, dgz, hgz)
        minus_year = self.multi_key_dict_get(
            {tuple(list("甲乙戊己")): 11, tuple(list("丙丁")): 3, tuple(list("庚辛")): 4, tuple(list("壬癸")): 9},
            ygz[0])
        result = two_gua + fgz + laoshao - minus_year
        return [result, "".join([gua_code.get(int(i)) for i in list(str(result))])]

    def jiazi(self):
        tiangan = self.tiangan
        dizhi = self.dizhi
        jiazi = [tiangan[x % len(tiangan)] + dizhi[x % len(dizhi)] for x in range(60)]
        return jiazi

    def multi_key_dict_get(self, d, k):
        for keys, v in d.items():
            if k in keys:
                return v
        return None

    def Ganzhiwuxing(self, gangorzhi):
        ganzhiwuxing = dict(zip(list(
            map(lambda x: tuple(x), "甲寅乙卯震巽,丙巳丁午离,壬亥癸子坎,庚申辛酉乾兑,未丑戊己未辰戌艮坤".split(","))),
                                list("木火水金土")))
        return self.multi_key_dict_get(ganzhiwuxing, gangorzhi)

    def find_wx_relation(self, zhi1, zhi2):
        return self.multi_key_dict_get(wuxing_relation_2, self.Ganzhiwuxing(zhi1) + self.Ganzhiwuxing(zhi2))

    def find_six_mons(self, daygangzhi):
        mons = [i[1] for i in self.data.get("六兽")]
        return self.new_list(mons, self.multi_key_dict_get(
            dict(zip([tuple(i) for i in '甲乙,丙丁,戊,己,庚辛,壬癸'.split(",")], mons)), daygangzhi[0]))

    def rev(self, l):
        r = []
        for i in l:
            r.insert(0, i)
        return r

    def show_sixtyfourguadescription(self, gua):
        sixtyfourguadescription = self.sixtyfourgua_description
        return sixtyfourguadescription.get(gua)

    # 五狗遁，起子时
    def find_lunar_minute(self, hour):
        fivedogs = {
            tuple(list('甲己')): '甲戌',
            tuple(list('乙庚')): '丙戌',
            tuple(list('丙辛')): '戊戌',
            tuple(list('丁壬')): '庚戌',
            tuple(list('戊癸')): '壬戌'
        }
        if self.multi_key_dict_get(fivedogs, hour[0]) == None:
            result = self.multi_key_dict_get(fivedogs, hour[1])
        else:
            result = self.multi_key_dict_get(fivedogs, hour[0])
        return self.new_list(jiazi(), result)

    # 五虎遁，起正月
    def find_lunar_month(self, year):
        fivetigers = {
            tuple(list('甲己')): '丙寅',
            tuple(list('乙庚')): '戊寅',
            tuple(list('丙辛')): '庚寅',
            tuple(list('丁壬')): '壬寅',
            tuple(list('戊癸')): '甲寅'
        }
        if self.multi_key_dict_get(fivetigers, year[0]) == None:
            result = self.multi_key_dict_get(fivetigers, year[1])
        else:
            result = self.multi_key_dict_get(fivetigers, year[0])
        return dict(zip(range(1, 13), self.new_list(self.jiazi(), result)[:12]))

    # 五鼠遁，起子时
    def find_lunar_hour(self, day):
        fiverats = {
            tuple(list('甲己')): '甲子',
            tuple(list('乙庚')): '丙子',
            tuple(list('丙辛')): '戊子',
            tuple(list('丁壬')): '庚子',
            tuple(list('戊癸')): '壬子'
        }
        if self.multi_key_dict_get(fiverats, day[0]) == None:
            result = self.multi_key_dict_get(fiverats, day[1])
        else:
            result = self.multi_key_dict_get(fiverats, day[0])
        return dict(zip(list(self.dizhi), self.new_list(self.jiazi(), result)[:12]))

    # 農曆
    def lunar_date_d(self, year, month, day):
        day = fromSolar(year, month, day)
        return {"年": day.getLunarYear(), "月": day.getLunarMonth(), "日": day.getLunarDay()}

    # 干支
    def gangzhi(self, year, month, day, hour, minute):

        if year == 0:
            return ["无效"]
        if year < 0:
            year = year + 1
        if hour == 23:
            d = Date(round((Date(
                "{}/{}/{} {}:00:00.00".format(str(year).zfill(4), str(month).zfill(2), str(day + 1).zfill(2),
                                              str(0).zfill(2)))), 3))
        else:
            d = Date("{}/{}/{} {}:00:00.00".format(str(year).zfill(4), str(month).zfill(2), str(day).zfill(2),
                                                   str(hour).zfill(2)))
        dd = list(d.tuple())
        cdate = fromSolar(dd[0], dd[1], dd[2])
        yTG, mTG, dTG, hTG = "{}{}".format(tian_gan[cdate.getYearGZ().tg], di_zhi[cdate.getYearGZ().dz]), "{}{}".format(
            tian_gan[cdate.getMonthGZ().tg], di_zhi[cdate.getMonthGZ().dz]), "{}{}".format(
            tian_gan[cdate.getDayGZ().tg], di_zhi[cdate.getDayGZ().dz]), "{}{}".format(
            tian_gan[cdate.getHourGZ(dd[3]).tg], di_zhi[cdate.getHourGZ(dd[3]).dz])
        if year < 1900:
            mTG1 = self.find_lunar_month(yTG).get(self.lunar_date_d(year, month, day).get("月"))
        else:
            mTG1 = mTG
        hTG1 = self.find_lunar_hour(dTG).get(hTG[1])
        zi = self.gangzhi1(year, month, day, 0, 0)[3]
        hourminute = str(hour) + ":" + str(minute)
        gangzhi_minute = self.minutes_jiazi_d(zi).get(hourminute)
        return [yTG, mTG1, dTG, hTG1, gangzhi_minute]

    # 換算干支
    def gangzhi1(self, year, month, day, hour, minute):
        if hour == 23:
            d = Date(round((Date(
                "{}/{}/{} {}:00:00.00".format(str(year).zfill(4), str(month).zfill(2), str(day + 1).zfill(2),
                                              str(0).zfill(2)))), 3))
        else:
            d = Date("{}/{}/{} {}:00:00.00".format(str(year).zfill(4), str(month).zfill(2), str(day).zfill(2),
                                                   str(hour).zfill(2)))
        dd = list(d.tuple())
        cdate = fromSolar(dd[0], dd[1], dd[2])
        yTG, mTG, dTG, hTG = "{}{}".format(tian_gan[cdate.getYearGZ().tg], di_zhi[cdate.getYearGZ().dz]), "{}{}".format(
            tian_gan[cdate.getMonthGZ().tg], di_zhi[cdate.getMonthGZ().dz]), "{}{}".format(
            tian_gan[cdate.getDayGZ().tg], di_zhi[cdate.getDayGZ().dz]), "{}{}".format(
            tian_gan[cdate.getHourGZ(dd[3]).tg], di_zhi[cdate.getHourGZ(dd[3]).dz])
        if year < 1900:
            mTG1 = self.find_lunar_month(yTG).get(self.lunar_date_d(year, month, day).get("月"))
        else:
            mTG1 = mTG
        hTG1 = self.find_lunar_hour(dTG).get(hTG[1])
        return [yTG, mTG1, dTG, hTG1]

    # 分干支
    def minutes_jiazi_d(self, hour):
        t = [f"{h}:{m}" for h in range(24) for m in range(60)]
        minutelist = dict(zip(t, cycle(repeat_list(1, self.find_lunar_minute(hour)))))
        return minutelist

    def mget_bookgua_details(self, guayao):
        getgua = self.multi_key_dict_get(self.sixtyfourgua, guayao)
        yao_results = self.sixtyfourgua_description.get(getgua)
        bian_yao = guayao.replace("6", "1").replace("9", "1").replace("7", "0").replace("8", "0")
        dong_yao = bian_yao.count("1")
        explaination = "动爻有【" + str(dong_yao) + "】根。"
        dong_yao_change = guayao.replace("6", "7").replace("9", "8")
        g_gua = self.multi_key_dict_get(self.sixtyfourgua, dong_yao_change)
        g_gua_result = self.sixtyfourgua_description.get(g_gua)
        b_gua_n_g_gua = "【" + getgua + "之" + g_gua + "】"
        top_bian_yao = bian_yao.rfind("1") + int(1)
        second_bian_yao = bian_yao.rfind("1", 0, bian_yao.rfind("1")) + int(1)
        top_jing_yao = bian_yao.rfind("0") + int(1)
        second_jing_yao = bian_yao.rfind("0", 0, bian_yao.rfind("0")) + int(1)
        top = yao_results.get(top_bian_yao)
        second = yao_results.get(second_bian_yao)
        # top_2 = yao_results.get(top_jing_yao)
        # second_2 = yao_results.get(second_jing_yao)
        explaination2 = None
        try:
            if dong_yao == 0:
                explaination2 = explaination, "主要看【" + getgua + "】卦彖词。", yao_results[7][2:]
            elif dong_yao == 1:
                explaination2 = explaination, b_gua_n_g_gua, "主要看【" + top[:2] + "】", top
            elif dong_yao == 2:
                explaination2 = b_gua_n_g_gua, explaination, "主要看【" + top[:2] + "】，其次看【" + second[
                                                                                                 :2] + "】。", top, second
            elif dong_yao == 3:
                if bian_yao.find("1") == 0:
                    explaination2 = b_gua_n_g_gua, explaination, "【" + getgua + "】卦为贞(我方)，【" + g_gua + "】卦为悔(他方)。前十卦，主贞【" + getgua + "】卦，请参考两卦彖词", \
                    yao_results[7][2:], g_gua_result[7][2:]
                elif bian_yao.find("1") > 0:
                    explaination2 = b_gua_n_g_gua, explaination, "【" + getgua + "】卦为贞(我方)，【" + g_gua + "】卦为悔(他方)。后十卦，主悔【" + g_gua + "】卦，请参考两卦彖词", \
                    g_gua_result[7][2:], yao_results[7][2:]
            elif dong_yao == 4:
                explaination2 = b_gua_n_g_gua, explaination, "主要看【" + g_gua + "】的" + g_gua_result.get(
                    second_jing_yao)[:2] + "，其次看" + g_gua_result.get(top_jing_yao)[:2] + "。", g_gua_result.get(
                    second_jing_yao), g_gua_result.get(top_jing_yao)
            elif dong_yao == 5:
                explaination2 = b_gua_n_g_gua, explaination, "主要看【" + g_gua + "】的" + g_gua_result.get(top_jing_yao)[
                                                                                         :2] + "。", g_gua_result.get(
                    top_jing_yao)
            elif dong_yao == 6:
                explaination2 = b_gua_n_g_gua, explaination, "主要看【" + g_gua + "】卦的彖词。", g_gua_result[7][2:]
        except (TypeError, UnboundLocalError):
            pass
        return [guayao, getgua, g_gua, yao_results, explaination2]

    def bookgua(self):  # 由底至上起爻
        shifa_results = []
        for i in range(6):
            stalks_first = 50 - 1  # 一变 (分二、掛一、揲四、歸奇)
            dividers = sorted(random.sample(range(24, stalks_first), 1))
            first_division = [a - b for a, b in zip(dividers + [stalks_first + 10], [10] + dividers)]
            guayi = 1
            right = first_division[0] - guayi
            left_extract = first_division[1] % 4
            if left_extract == 0:
                left_extract = 4
            right_extract = right % 4
            if right_extract == 0:
                right_extract = 4
            yibian = left_extract + right_extract + guayi  # 二变 (分二、掛一、揲四、歸奇)
            stalks_second = stalks_first - yibian
            second_dividers = sorted(random.sample(range(12, stalks_second), 1))
            second_division = [a - b for a, b in zip(second_dividers + [stalks_second + 5], [5] + second_dividers)]
            right_second = second_division[0] - guayi
            left_extract_second = second_division[1] % 4
            if left_extract_second == 0:
                left_extract_second = 4
            right_extract_second = right_second % 4
            if right_extract_second == 0:
                right_extract_second = 4
            erbian = left_extract_second + right_extract_second + guayi  # 三变 (分二、掛一、揲四、歸奇)
            stalks_third = stalks_second - erbian
            third_dividers = sorted(random.sample(range(6, stalks_third), 1))
            third_division = [a - b for a, b in zip(third_dividers + [stalks_third + 3], [3] + third_dividers)]
            right_third = third_division[0] - guayi
            left_extract_third = third_division[1] % 4
            if left_extract_third == 0:
                left_extract_third = 4
            right_extract_third = right_third % 4
            if right_extract_third == 0:
                right_extract_third = 4
            sanbian = left_extract_third + right_extract_third + guayi
            yao = int((stalks_first - yibian - erbian - sanbian) / 4)
            shifa_results.append(yao)
        return "".join(str(e) for e in shifa_results[:6])

    def datetime_bookgua(self, y, m, d, h, minute):
        gangzhi = self.gangzhi(y, m, d, h, minute)
        ld = self.lunar_date_d(y, m, d)
        zhi_code = dict(zip(self.dizhi, range(1, 13)))
        yz_code = zhi_code.get(gangzhi[0][1])
        hz_code = zhi_code.get(gangzhi[3][1])
        cm = ld.get("月")
        cd = ld.get("日")
        eightgua = {1: "777", 2: "778", 3: "787", 4: "788", 5: "877", 6: "878", 7: "887", 8: "888"}
        upper_gua_remain = (yz_code + cm + cd + hz_code) % 8
        if upper_gua_remain == 0:
            upper_gua_remain = int(8)
        upper_gua = eightgua.get(upper_gua_remain)
        lower_gua_remain = (yz_code + cm + cd) % 8
        if lower_gua_remain == 0:
            lower_gua_remain = int(8)
        lower_gua = eightgua.get(lower_gua_remain)
        combine_gua1 = lower_gua + upper_gua
        combine_gua = list(combine_gua1)
        bian_yao = (yz_code + cm + cd + hz_code) % 6
        if bian_yao == 0:
            bian_yao = int(6)
        elif bian_yao != 0:
            combine_gua[bian_yao - 1] = combine_gua[bian_yao - 1].replace("7", "9").replace("8", "6")
        bian_gua = "".join(combine_gua)
        ben_gua = self.multi_key_dict_get(self.sixtyfourgua, bian_gua)
        description = self.multi_key_dict_get(self.sixtyfourgua_description, ben_gua)
        g_gua = self.multi_key_dict_get(self.sixtyfourgua, (bian_gua.replace("6", "7").replace("9", "8")))
        return ben_gua + "之" + g_gua, self.eightgua_element.get(upper_gua_remain) + self.eightgua_element.get(
            lower_gua_remain) + ben_gua, "变爻为" + description[bian_yao][:2], description[bian_yao][3:]

    def bookgua_details(self):
        return self.mget_bookgua_details(self.bookgua())

    # 現在时间起卦
    def current_bookgua(self):
        now = datetime.datetime.now()
        return self.datetime_bookgua(int(now.year), int(now.month), int(now.day), int(now.hour), int(now.minute))

    def dc_gua(self, gua):
        fivestars = self.data.get("五星")
        eightgua = self.data.get("数字排八卦")
        sixtyfourgua = self.data.get("数字排六十四卦")
        su_yao = self.data.get("二十八宿配干支")
        shiying = self.multi_key_dict_get(self.data.get("八宫卦"), self.multi_key_dict_get(sixtyfourgua, gua))
        Shiying = list(self.findshiying.get(shiying))
        dgua = self.multi_key_dict_get(eightgua, gua[0:3])
        down_gua = self.gua_down_code.get(dgua)
        ugua = self.multi_key_dict_get(eightgua, gua[3:6])
        up_gua = self.gua_up_code.get(ugua)
        dt = [self.tiangan[int(g[0])] for g in [down_gua[i].split(',') for i in range(0, 3)]]
        dd = [self.dizhi[int(g[1])] for g in [down_gua[i].split(',') for i in range(0, 3)]]
        dw = [self.wuxin[int(g[2])] for g in [down_gua[i].split(',') for i in range(0, 3)]]
        ut = [self.tiangan[int(g[0])] for g in [up_gua[i].split(',') for i in range(0, 3)]]
        ud = [self.dizhi[int(g[1])] for g in [up_gua[i].split(',') for i in range(0, 3)]]
        uw = [self.wuxin[int(g[2])] for g in [up_gua[i].split(',') for i in range(0, 3)]]
        t = dt + ut
        d = dd + ud
        w = dw + uw
        find_gua_wuxing = self.multi_key_dict_get(self.data.get("八宫卦五行"),
                                                  self.multi_key_dict_get(sixtyfourgua, gua))
        # liuqin = [i[0] for i in self.liuqin]
        lq = [self.multi_key_dict_get(self.liuqin_w, i + find_gua_wuxing) for i in dw + uw]
        gua_name = self.multi_key_dict_get(sixtyfourgua, gua)
        find_su = dict(zip(self.sixtyfour_gua_index, self.chin_iter(self.chin_list, "参"))).get(gua_name)
        sy = dict(zip(self.sixtyfour_gua_index, su_yao)).get(gua_name)
        ng = [t[i] + d[i] for i in range(0, 6)]
        sy2 = [c == sy for c in ng]
        sy3 = [str(i).replace("False", "").replace("True", find_su) for i in sy2]
        ss = dict(zip(self.sixtyfour_gua_index, self.chin_iter(fivestars, "镇星"))).get(gua_name)
        position = sy3.index(find_su)
        if position == 0:
            g = self.new_list(self.chin_list, find_su)[0:6]
        elif position == 5:
            g = list(reversed(self.new_list(self.chin_list, find_su)))[-6:]
        elif position == 4:
            g = list(reversed(self.new_list(self.chin_list, find_su)))[-6:][1:] + [
                list(reversed(self.new_list(self.chin_list, find_su)))[0]]
        elif position == 3:
            g = list(reversed(self.new_list(self.chin_list, find_su)))[-6:][2:] + list(
                reversed(self.new_list(self.chin_list, find_su)))[0:2]
        elif position == 2:
            g = list(reversed(self.new_list(self.chin_list, find_su)))[-6:][3:] + list(
                reversed(self.new_list(self.chin_list, find_su)))[0:3]
        elif position == 1:
            g = list(reversed(self.new_list(self.chin_list, find_su)))[-6:][4:] + list(
                reversed(self.new_list(self.chin_list, find_su)))[0:4]
        build_month_code = dict(zip(self.data.get("六十四卦"), self.data.get("月建"))).get(gua_name)
        build_month = self.new_list(self.jiazi(), build_month_code)[0:6]
        accumulate_code = dict(zip(self.data.get("六十四卦"), self.data.get("积算"))).get(gua_name)
        accumulate = self.new_list(self.jiazi(), accumulate_code)
        return {"卦": gua_name,
                "五星": ss,
                "世应卦": shiying + "卦",
                "星宿": g,
                "天干": t,
                "地支": d,
                "五行": w,
                "世应": Shiying,
                "六亲用神": lq,
                "纳甲": ng,
                "建月": build_month,
                "积算": [list(i) for i in np.array_split(accumulate, 10)]}

    def decode_gua(self, gua, daygangzhi=None):
        if daygangzhi is None:
            now = datetime.datetime.now()
            daygangzhi = self.gangzhi(int(now.year), int(now.month), int(now.day), int(now.hour))[2]
        fivestars = self.data.get("五星")
        eightgua = self.data.get("数字排八卦")
        sixtyfourgua = self.data.get("数字排六十四卦")
        su_yao = self.data.get("二十八宿配干支")
        shiying = self.multi_key_dict_get(self.data.get("八宫卦"), self.multi_key_dict_get(sixtyfourgua, gua))
        Shiying = list(self.findshiying.get(shiying))
        dgua = self.multi_key_dict_get(eightgua, gua[0:3])
        down_gua = self.gua_down_code.get(dgua)
        ugua = self.multi_key_dict_get(eightgua, gua[3:6])
        up_gua = self.gua_up_code.get(ugua)
        dt = [self.tiangan[int(g[0])] for g in [down_gua[i].split(',') for i in range(0, 3)]]
        dd = [self.dizhi[int(g[1])] for g in [down_gua[i].split(',') for i in range(0, 3)]]
        dw = [self.wuxin[int(g[2])] for g in [down_gua[i].split(',') for i in range(0, 3)]]
        ut = [self.tiangan[int(g[0])] for g in [up_gua[i].split(',') for i in range(0, 3)]]
        ud = [self.dizhi[int(g[1])] for g in [up_gua[i].split(',') for i in range(0, 3)]]
        uw = [self.wuxin[int(g[2])] for g in [up_gua[i].split(',') for i in range(0, 3)]]
        t = dt + ut
        d = dd + ud
        w = dw + uw
        find_gua_wuxing = self.multi_key_dict_get(self.data.get("八宫卦五行"),
                                                  self.multi_key_dict_get(sixtyfourgua, gua))
        liuqin = [i[0] for i in self.liuqin]
        lq = [self.multi_key_dict_get(self.liuqin_w, i + find_gua_wuxing) for i in dw + uw]
        gua_name = self.multi_key_dict_get(sixtyfourgua, gua)
        find_su = dict(zip(self.sixtyfour_gua_index, self.chin_iter(self.chin_list, "参"))).get(gua_name)
        sy = dict(zip(self.sixtyfour_gua_index, su_yao)).get(gua_name)
        ng = [t[i] + d[i] for i in range(0, 6)]
        sy2 = [c == sy for c in ng]
        sy3 = [str(i).replace("False", "").replace("True", find_su) for i in sy2]
        ss = dict(zip(self.sixtyfour_gua_index, self.chin_iter(fivestars, "镇星"))).get(gua_name)
        position = sy3.index(find_su)
        if position == 0:
            g = self.new_list(self.chin_list, find_su)[0:6]
        elif position == 5:
            g = list(reversed(self.new_list(self.chin_list, find_su)))[-6:]
        elif position == 4:
            g = list(reversed(self.new_list(self.chin_list, find_su)))[-6:][1:] + [
                list(reversed(self.new_list(self.chin_list, find_su)))[0]]
        elif position == 3:
            g = list(reversed(self.new_list(self.chin_list, find_su)))[-6:][2:] + list(
                reversed(self.new_list(self.chin_list, find_su)))[0:2]
        elif position == 2:
            g = list(reversed(self.new_list(self.chin_list, find_su)))[-6:][3:] + list(
                reversed(self.new_list(self.chin_list, find_su)))[0:3]
        elif position == 1:
            g = list(reversed(self.new_list(self.chin_list, find_su)))[-6:][4:] + list(
                reversed(self.new_list(self.chin_list, find_su)))[0:4]
        build_month_code = dict(zip(self.data.get("六十四卦"), self.data.get("月建"))).get(gua_name)
        build_month = self.new_list(self.jiazi(), build_month_code)[0:6]
        accumulate_code = dict(zip(self.data.get("六十四卦"), self.data.get("积算"))).get(gua_name)
        accumulate = self.new_list(self.jiazi(), accumulate_code)
        aa = list(set(lq))
        fu = str(str([value for value in liuqin if value not in aa]).replace("['", "").replace("']", ""))
        fu_gua = self.dc_gua(self.multi_key_dict_get(self.bagua_pure_code, gua_name))
        fu_gua_gang = fu_gua.get("天干")
        fu_gua_zhi = fu_gua.get("地支")
        fu_gua_wu = fu_gua.get("五行")
        fu_gua_lq = fu_gua.get("六亲用神")
        shen = self.multi_key_dict_get(self.shen, d[Shiying.index("世")])
        try:
            fu_num = fu_gua_lq.index(fu)
            fuyao = [str(g == fu) for g in fu_gua_lq].index('True')
            fuyao1 = fu_gua_lq[fu_num] + fu_gua_gang[fu_num] + fu_gua_zhi[fu_num] + fu_gua_wu[fu_num]
            fu_yao = {"伏神所在爻": lq[fuyao], "伏神六亲": fu, "伏神排爻数字": fu_num,
                      "本卦伏神所在爻": lq[fu_num] + t[fu_num] + d[fu_num] + w[fu_num], "伏神爻": fuyao1}

        except (ValueError, IndexError, AttributeError):
            fu_yao = ""

        return {"卦": gua_name,
                "五星": ss,
                "世应卦": shiying + "卦",
                "星宿": g,
                "天干": t,
                "地支": d,
                "五行": w,
                "世应爻": Shiying,
                "身爻": lq[shen] + t[shen] + d[shen] + w[shen],
                "六亲用神": lq,
                "伏神": fu_yao,
                "六兽": self.find_six_mons(daygangzhi),
                "纳甲": ng,
                "建月": build_month,
                "积算": [list(i) for i in np.array_split(accumulate, 10)]}

    def decode_two_gua(self, bengua, ggua, daygangzhi=None):
        if daygangzhi is None:
            now = datetime.datetime.now()
            daygangzhi = self.gangzhi(int(now.year), int(now.month), int(now.day), int(now.hour))[2]
        a = self.decode_gua(bengua, daygangzhi)
        b = self.decode_gua(ggua, daygangzhi)
        try:
            fu_yao = a.get("伏神").get("伏神爻")
            fu_ben_yao = a.get("伏神").get('本卦伏神所在爻')
            g_yao = b.get("六亲用神") + b.get("天干") + b.get("地支") + b.get("五行")
            if fu_yao == g_yao:
                fei = fu_ben_yao
            else:
                fei = ""
        except (ValueError, IndexError, AttributeError):
            fei = ""
        return {"本卦": a, "之卦": b, "飞神": fei}

    def qigua_time(self, y, m, d, h, minute):
        gangzhi = self.gangzhi(y, m, d, h, minute)
        ld = self.lunar_date_d(y, m, d)
        zhi_code = dict(zip(self.dizhi, range(1, 13)))
        yz_code = zhi_code.get(gangzhi[0][1])
        hz_code = zhi_code.get(gangzhi[3][1])
        cm = ld.get("月")
        cd = ld.get("日")
        eightgua = self.data.get("八卦数值")
        lower_gua_remain = (yz_code + cm + cd + hz_code) % 8
        upper_gua_remain = (yz_code + cm + cd) % 8
        if upper_gua_remain == 0:
            upper_gua_remain = int(8)
        upper_gua = eightgua.get(upper_gua_remain)
        if lower_gua_remain == 0:
            lower_gua_remain = int(8)
        lower_gua = eightgua.get(lower_gua_remain)
        combine_gua1 = lower_gua + upper_gua
        combine_gua = list(combine_gua1)
        bian_yao = (yz_code + cm + cd + hz_code) % 6
        if bian_yao == 0:
            bian_yao = int(6)
        elif bian_yao != 0:
            b = combine_gua[bian_yao - 1].replace("7", "9").replace("8", "6")
        b = combine_gua[bian_yao - 1].replace("7", "9").replace("8", "6")
        combine_gua[bian_yao - 1] = b
        bian_gua = "".join(combine_gua)
        ggua = bian_gua.replace("6", "7").replace("9", "8")
        return {**{'日期': gangzhi[0] + "年" + gangzhi[1] + "月" + gangzhi[2] + "日" + gangzhi[3] + "时"},
                **{"大衍筮法": self.mget_bookgua_details(bian_gua)}, **self.decode_two_gua(bian_gua, ggua, gangzhi[2])}

    def qigua_time_minute(self, y, m, d, h, minute):
        gangzhi = self.gangzhi(y, m, d, h, minute)
        ld = self.lunar_date_d(y, m, d)
        zhi_code = dict(zip(self.dizhi, range(1, 13)))
        yz_code = zhi_code.get(gangzhi[0][1])
        hz_code = zhi_code.get(gangzhi[3][1])
        minz_code = zhi_code.get(gangzhi[4][1])
        cm = ld.get("月")
        cd = ld.get("日")
        eightgua = self.data.get("八卦数值")
        lower_gua_remain = (yz_code + cm + cd + hz_code + minz_code) % 8
        upper_gua_remain = (yz_code + cm + cd + hz_code) % 8
        if upper_gua_remain == 0:
            upper_gua_remain = int(8)
        upper_gua = eightgua.get(upper_gua_remain)
        if lower_gua_remain == 0:
            lower_gua_remain = int(8)
        lower_gua = eightgua.get(lower_gua_remain)
        combine_gua1 = lower_gua + upper_gua
        combine_gua = list(combine_gua1)
        bian_yao = (yz_code + cm + cd + hz_code + minz_code) % 6
        if bian_yao == 0:
            bian_yao = int(6)
        elif bian_yao != 0:
            b = combine_gua[bian_yao - 1].replace("7", "9").replace("8", "6")
        b = combine_gua[bian_yao - 1].replace("7", "9").replace("8", "6")
        combine_gua[bian_yao - 1] = b
        bian_gua = "".join(combine_gua)
        ggua = bian_gua.replace("6", "7").replace("9", "8")
        return {**{'日期': gangzhi[0] + "年" + gangzhi[1] + "月" + gangzhi[2] + "日" + gangzhi[3] + "时"},
                **{"大衍筮法": self.mget_bookgua_details(bian_gua)}, **self.decode_two_gua(bian_gua, ggua, gangzhi[2])}

    def qigua_now(self):
        now = datetime.datetime.now()
        return self.qigua_time(int(now.year), int(now.month), int(now.day), int(now.hour), int(now.minute))

    def qigua_manual(self, y, m, d, h, minute, gua):
        gangzhi = self.gangzhi(y, m, d, h, minute)
        ggua = gua.replace("6", "7").replace("9", "8")
        return {**{'日期': gangzhi[0] + "年" + gangzhi[1] + "月" + gangzhi[2] + "日" + gangzhi[3] + "时"},
                **{"大衍筮法": self.mget_bookgua_details(gua)}, **self.decode_two_gua(gua, ggua, gangzhi[2])}

    # 先天策轨数
    def innate_cegui(self, year, month, day, hour, minute):
        innate_gua = list("ｏ乾兑离震巽坎艮坤乾")
        innate_kinkun_num = {tuple([7, 9]): 216, tuple([6, 8]): 180}
        dongyao_position = {tuple([0, 1, 2]): "下卦", tuple([3, 4, 5]): "上卦"}
        gua = self.qigua_time(year, month, day, hour, minute).get("大衍筮法")[0]
        gua1 = list(str(gua.replace("9", "7").replace("6", "8")))
        gua_sum = sum([{"7": 36, "8": 24}.get(i) for i in gua1])
        gua2 = list(gua)
        lower = "".join(gua1[0:3])
        upper = "".join(gua1[3:6])
        lower_g = bidict(self.eightgua).inverse[lower]
        upper_g = bidict(self.eightgua).inverse[upper]
        try:
            dy = gua2.index("6")
        except ValueError:
            dy = gua2.index("9")
        dongyao = {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6}.get(dy)
        dy_p = multi_key_dict_get(dongyao_position, dy)
        if dy_p == "下卦":
            innate_num = (lower_g * 10 * gua_sum) + (dongyao * gua_sum) + gua_sum + (upper_g + lower_g + dongyao)
        if dy_p == "上卦":
            innate_num = (dongyao * 10 * gua_sum) + (upper_g * gua_sum) + gua_sum + (upper_g + lower_g + dongyao)
        if innate_num > 10000:
            innate_num = (str(innate_num - 10000)).zfill(4)
        num_to_wuxing = dict(zip(list(range(0, 10)), list("空水火木金土水火木金土")))
        return [list("元会运世"),
                [cn2an.transform(str(i), "an2cn") for i in list(str(innate_num))],
                [dict(zip(range(0, 10), innate_gua)).get(int(i)) for i in list(str(innate_num))],
                [num_to_wuxing.get(int(i)) for i in list(str(innate_num))]]

    # 后天策轨数
    def acquired_cegui(self, year, month, day, hour, minute):
        acquired_gua = list("ｏ坎坤震巽ｏ乾兑艮离")
        innate_kinkun_num = {tuple([7, 9]): 768, tuple([6, 8]): 672}
        dongyao_position = {tuple([0, 1, 2]): "下卦", tuple([3, 4, 5]): "上卦"}
        gua = self.qigua_time(year, month, day, hour, minute).get("大衍筮法")[0]
        gua1 = list(str(gua.replace("9", "7").replace("6", "8")))
        gua_sum = sum([{"7": 128, "8": 112}.get(i) for i in gua1])
        gua2 = list(gua)
        lower = "".join(gua1[0:3])
        upper = "".join(gua1[3:6])
        lower_g = bidict(self.eightgua).inverse[lower]
        upper_g = bidict(self.eightgua).inverse[upper]
        try:
            dy = gua2.index("6")
        except ValueError:
            dy = gua2.index("9")
        dongyao = {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6}.get(dy)
        dy_p = multi_key_dict_get(dongyao_position, dy)
        if dy_p == "下卦":
            innate_num = (lower_g * 10 * gua_sum) + (dongyao * gua_sum) + gua_sum + (upper_g + lower_g + dongyao)
        if dy_p == "上卦":
            innate_num = (dongyao * 10 * gua_sum) + (upper_g * gua_sum) + gua_sum + (upper_g + lower_g + dongyao)
        if innate_num < 10000:
            innate_num = str(innate_num).zfill(5)
        num_to_wuxing = dict(zip(list(range(0, 10)), list("空水火木金土水火木金土")))
        # ac_num = [cn2an.transform(str(i), "an2cn") for i in list(str(innate_num))]
        return [list("万元会运世"),
                [cn2an.transform(str(i), "an2cn") for i in list(str(innate_num))],
                [dict(zip(range(0, 10), acquired_gua)).get(int(i)) for i in list(str(innate_num))],
                [num_to_wuxing.get(int(i)) for i in list(str(innate_num))]]

    def get_acquired_code(self, year, month, day, hour, minute):
        ac = self.acquired_cegui(year, month, day, hour, minute)[1]
        return acquire_num_dict.get("".join(ac))

    def display_pan_m(self, year, month, day, hour, minute, mgua):
        gz = self.gangzhi(year, month, day, hour, minute)
        oo = self.qigua_manual(year, month, day, hour, minute, mgua).get('大衍筮法')
        ogua = self.qigua_manual(year, month, day, hour, minute, mgua).get('大衍筮法')[0]
        bengua = self.qigua_manual(year, month, day, hour, minute, mgua).get("本卦")
        ggua = self.qigua_manual(year, month, day, hour, minute, mgua).get("之卦")
        gb = ogua.replace("9", "8").replace("6", "7")
        wugua = ogua.replace("9", "7").replace("6", "8")[1:4] + gb[2:5]
        b1 = self.qigua_manual(year, month, day, hour, minute, mgua).get("本卦").get("星宿")
        b2 = self.qigua_manual(year, month, day, hour, minute, mgua).get("本卦").get('六亲用神')
        b3 = self.qigua_manual(year, month, day, hour, minute, mgua).get("本卦").get('纳甲')
        b4 = self.qigua_manual(year, month, day, hour, minute, mgua).get("本卦").get('五行')
        b5 = self.qigua_manual(year, month, day, hour, minute, mgua).get("本卦").get('世应爻')
        g1 = self.qigua_manual(year, month, day, hour, minute, mgua).get("之卦").get("星宿")
        g2 = self.qigua_manual(year, month, day, hour, minute, mgua).get("之卦").get('六亲用神')
        g3 = self.qigua_manual(year, month, day, hour, minute, mgua).get("之卦").get('纳甲')
        g4 = self.qigua_manual(year, month, day, hour, minute, mgua).get("之卦").get('五行')
        g5 = self.qigua_manual(year, month, day, hour, minute, mgua).get("之卦").get('世应爻')
        try:
            gua_no_yao = {"父": "卦无【父母】，乃帜不备也。",
                          "妻": "卦无【妻财】，粮草缺绝也。",
                          "官": "卦无【官鬼】，如与鬼墓绝胎者，敌必遁去也。",
                          "子": "卦无【子孙】，动来救。",
                          "兄": "卦无【兄弟】，防奸细也。"}.get(list(set(list("官父妻兄子")) - set(b2))[0])
        except IndexError:
            gua_no_yao = ""
        guayaodict = {"6": "▅▅ ▅▅ X", "7": "▅▅▅▅▅  ", "8": "▅▅ ▅▅  ", "9": "▅▅▅▅▅ O"}
        # guayaodict = {"6":"▅▅　▅▅ X", "7":"▅▅▅▅▅  ", "8":"▅▅　▅▅  ", "9":"▅▅▅▅▅ O"}
        bg = [guayaodict.get(i) for i in list(ogua)]
        gb1 = [guayaodict.get(i) for i in list(gb)]
        wgb = [guayaodict.get(i) for i in list(wugua)]
        bg_yaolist = ["".join([b2[i], b3[i], b4[i], b5[i]]) for i in range(0, 6)]
        # gg_yaolist = ["".join([b2[i],b3[i],b4[i],b5[i]]) for i in range(0,6)]
        smons = self.find_six_mons(gz[2][0])
        lunar_month = self.lunar_date_d(year, month, day).get("月")
        build_month = self.find_lunar_month(gz[0]).get(lunar_month)
        dong_yaos = [i.replace("7", "").replace("8", "").replace("6", "动").replace("9", "动") for i in list(ogua)]
        qin_elements = dict(zip(b2, [b2[i] + b4[i] + dong_yaos[i] for i in range(0, 6)]))
        by = {
            0: ["身", "　", "　", "　", "　", "　"],
            1: ["　", "身", "　", "　", "　", "　"],
            2: ["　", "　", "身", "　", "　", "　"],
            3: ["　", "　", "　", "身", "　", "　"],
            4: ["　", "　", "　", "　", "身", "　"],
            5: ["　", "　", "　", "　", "　", "身"],
        }.get([b2[i] + b3[i] for i in range(0, 6)].index(bengua.get('身爻')[0:3]))
        try:
            fugod1 = bengua.get("伏神").get("伏神排爻数字")
            fugod2 = ggua.get("伏神").get("伏神排爻数字")
            fyao1 = bengua.get("伏神").get("伏神爻")
            fyao2 = ggua.get("伏神").get("伏神爻")
            fu_location = {0: [fyao1, "　　　　", "　　　　", "　　　　", "　　　　", "　　　　"],
                           1: ["　　　　", fyao1, "　　　　", "　　　　", "　　　　", "　　　　"],
                           2: ["　　　　", "　　　　", fyao1, "　　　　", "　　　　", "　　　　"],
                           3: ["　　　　", "　　　　", "　　　　", fyao1, "　　　　", "　　　　"],
                           4: ["　　　　", "　　　　", "　　　　", "　　　　", fyao1, "　　　　"],
                           5: ["　　　　", "　　　　", "　　　　", "　　　　", "　　　　", fyao1]}
            fu_location1 = {0: [fyao2, "　　　　", "　　　　", "　　　　", "　　　　", "　　　　"],
                            1: ["　　　　", fyao2, "　　　　", "　　　　", "　　　　", "　　　　"],
                            2: ["　　　　", "　　　　", fyao2, "　　　　", "　　　　", "　　　　"],
                            3: ["　　　　", "　　　　", "　　　　", fyao2, "　　　　", "　　　　"],
                            4: ["　　　　", "　　　　", "　　　　", "　　　　", fyao2, "　　　　"],
                            5: ["　　　　", "　　　　", "　　　　", "　　　　", "　　　　", fyao2]}
            fufu = fu_location.get(fugod1)
            fufu2 = fu_location1.get(fugod2)
            flylocation = bengua.get("伏神").get('本卦伏神所在爻')
            flygodyao = bengua.get("伏神").get('本卦伏神所在爻')[2:]
            fugodyao = fyao1[2:]
            if flylocation[0] == "父":
                father_lay_dist = {"子": "父下伏子，眾将慑服，擒纵如意也。",
                                   "妻": "父下伏财，备器足饷，智无遗算，但左右防伏戎也。",
                                   "兄": "父下伏兄，贪财好色，狎侮私人也。",
                                   "官": "父下伏鬼，智短计拙，动见疏虞也。"}.get(fyao1[0])
            else:
                father_lay_dist = ""
            flyfu_relation = self.find_wx_relation(flygodyao[0], fugodyao[0])
            if flyfu_relation == "我克":
                ff_relation = "我克】，飞来克伏为害，为凶。"
            if flyfu_relation == "克我":
                ff_relation = "克我】，伏克飞神为出暴，出暴者，凶而快。"
            if flyfu_relation == "比和":
                ff_relation = "比和】。"
            if flyfu_relation == "生我":
                ff_relation = flyfu_relation + "】。"
            if flyfu_relation == "我生":
                ff_relation = flyfu_relation + "】。"
            flyfu_dist = "伏神爻【" + fyao1 + "】，飞神【" + flygodyao + "】在【" + flylocation + "】，伏神【" + fugodyao + "】，飞伏关系为【" + ff_relation
        except AttributeError:
            fufu = ["　　　　", "　　　　", "　　　　", "　　　　", "　　　　", "　　　　"]
            fufu2 = ["　　　　", "　　　　", "　　　　", "　　　　", "　　　　", "　　　　"]
            flyfu_dist = ""
        daykong = self.daykong_shikong(year, month, day, hour, minute).get("日空")
        hourkong = self.daykong_shikong(year, month, day, hour, minute).get("时空")
        gettwelve = self.find_shier_luck(gz[2][0])
        twelvelucks = "".join([self.find_shier_luck(gz[2][0]).get(i) + "　" for i in self.dizhi])
        twelvelucks_hour = self.find_shier_luck(gz[3][0])
        twelvelucks_hour1 = "".join([self.find_shier_luck(gz[3][0]).get(i) + "　" for i in self.dizhi])
        try:
            father_luck = self.multi_key_dict_get(
                {("衰　", "病　", "死　", "墓　", "绝　"): "父母爻处衰绝，主队军师老髦也，守旧保守也。",
                 ("长生", "沐浴", "冠带", "临官", "帝旺"): "父母爻处旺相，主队军师少壮也，开明进取也。",
                 ("胎　", "养　"): "父母爻处胎、养，主队军师不威重也，欠谋略。"}, twelvelucks_hour.get(b3[b2.index("父")][1]))
        except (ValueError, IndexError):
            father_luck = ""
        a = "起卦时间︰{}年{}月{}日{}时{}分\n".format(year, month, day, hour, minute)
        b = "農曆︰{}{}月{}日\n".format(cn2an.transform(str(year) + "年", "an2cn"),
                                       an2cn(self.lunar_date_d(year, month, day).get("月")),
                                       an2cn(self.lunar_date_d(year, month, day).get("日")))
        c = "干支︰{}年  {}月  {}日  {}时\n".format(gz[0], gz[1], gz[2], gz[3])
        j_q = jq(year, month, day, hour, minute)
        c0 = "节气︰{} | 旺︰{} | 相︰{}\n".format(j_q, gong_wangzhuai(j_q)[1].get("旺"), gong_wangzhuai(j_q)[1].get("相"))
        c1 = "旬空︰　　　  　　　  {}    {}\n".format(daykong, hourkong)
        c2 = "月建︰　　　  {}\n\n".format(build_month)
        c3 = "　　　　" + "".join([i + "　　" for i in self.dizhi]) + "\n"
        c4 = "　　　　" + "".join([self.Ganzhiwuxing(i) + "　　" for i in self.dizhi]) + "\n"
        c5 = "日支运︰" + twelvelucks + "\n"
        c5_1 = "时支运︰" + twelvelucks_hour1 + "\n\n"
        d = "　　　　　　　       　 　{}卦　　　　　　　　　　 　　　　　              　  {}卦                \n".format(bengua.get("卦"),
                                                                                                  ggua.get("卦"))
        e = "六神　  伏神　　         本卦　　　　　　　　　　　       互卦               伏神　　   之卦\n"
        f = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}　\n".format(smons[5], fufu[5], b1[5],
                                                                                         b2[5], b3[5], b4[5],
                                                                                         twelvelucks_hour.get(b3[5][1]),
                                                                                         b5[5].replace("六", "　"),
                                                                                         bg[5], by[5], wgb[5], fufu2[5],
                                                                                         g1[5], g2[5], g3[5], g4[5],
                                                                                         g5[5].replace("六", "　"),
                                                                                         gb1[5])
        g = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}  \n".format(smons[4], fufu[4], b1[4],
                                                                                          b2[4], b3[4], b4[4],
                                                                                          twelvelucks_hour.get(
                                                                                              b3[4][1]),
                                                                                          b5[4].replace("五", "　"),
                                                                                          bg[4], by[4], wgb[4],
                                                                                          fufu2[4], g1[4], g2[4], g3[4],
                                                                                          g4[4],
                                                                                          g5[4].replace("五", "　"),
                                                                                          gb1[4])
        h = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}  \n".format(smons[3], fufu[3], b1[3],
                                                                                          b2[3], b3[3], b4[3],
                                                                                          twelvelucks_hour.get(
                                                                                              b3[3][1]),
                                                                                          b5[3].replace("四", "　"),
                                                                                          bg[3], by[3], wgb[3],
                                                                                          fufu2[3], g1[3], g2[3], g3[3],
                                                                                          g4[3],
                                                                                          g5[3].replace("四", "　"),
                                                                                          gb1[3])
        i = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}  \n".format(smons[2], fufu[2], b1[2],
                                                                                          b2[2], b3[2], b4[2],
                                                                                          twelvelucks_hour.get(
                                                                                              b3[2][1]),
                                                                                          b5[2].replace("三", "　"),
                                                                                          bg[2], by[2], wgb[2],
                                                                                          fufu2[2], g1[2], g2[2], g3[2],
                                                                                          g4[2],
                                                                                          g5[2].replace("三", "　"),
                                                                                          gb1[2])
        j = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}  \n".format(smons[1], fufu[1], b1[1],
                                                                                          b2[1], b3[1], b4[1],
                                                                                          twelvelucks_hour.get(
                                                                                              b3[1][1]),
                                                                                          b5[1].replace("二", "　"),
                                                                                          bg[1], by[1], wgb[1],
                                                                                          fufu2[1], g1[1], g2[1], g3[1],
                                                                                          g4[1],
                                                                                          g5[1].replace("二", "　"),
                                                                                          gb1[1])
        k = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}  \n\n\n".format(smons[0], fufu[0], b1[0],
                                                                                              b2[0], b3[0], b4[0],
                                                                                              twelvelucks_hour.get(
                                                                                                  b3[0][1]),
                                                                                              b5[0].replace("初", "　"),
                                                                                              bg[0], by[0], wgb[0],
                                                                                              fufu2[0], g1[0], g2[0],
                                                                                              g3[0], g4[0],
                                                                                              g5[0].replace("初", "　"),
                                                                                              gb1[0])
        l = "【大衍筮法】\n"
        try:
            m = "求得【{}之{}】，{}{}{}\n\n".format(oo[1], oo[2], oo[4][0], oo[4][2], oo[4][3])
        except IndexError:
            m = "求得【{}之{}】，{}{}\n\n".format(oo[1], oo[2], oo[4][0], oo[4][2])
        n = "【{}卦】\n卦词︰{}\n彖︰{}\n{}\n{}\n{}\n{}\n{}\n{}\n\n".format(oo[1], oo[3].get(0), oo[3].get(7)[2:],
                                                                        oo[3].get(6), oo[3].get(5), oo[3].get(4),
                                                                        oo[3].get(3), oo[3].get(2), oo[3].get(1))
        eightgua = {'777': "乾金", '778': "兑金", '787': "离火", '788': "震木", '877': "巽木", '878': "坎水",
                    '887': "艮土", '888': "坤土"}
        downgua = eightgua.get(ogua[0:3].replace("6", "8").replace("9", "7"))
        upgua = eightgua.get(ogua[3:6].replace("6", "8").replace("9", "7"))
        status = {("旺", "相"): "，吉也", ("胎", "没"): "，平也", ("死", "囚", "休", "废"): "，凶也"}
        downgua1 = "【" + gong_wangzhuai(j_q)[0].get(downgua[0]) + "】" + self.multi_key_dict_get(status,
                                                                                                gong_wangzhuai(j_q)[
                                                                                                    0].get(downgua[0]))
        upgua1 = "【" + gong_wangzhuai(j_q)[0].get(upgua[0]) + "】" + self.multi_key_dict_get(status,
                                                                                            gong_wangzhuai(j_q)[0].get(
                                                                                                upgua[0]))
        shi = bg_yaolist[["世" in i for i in bg_yaolist].index(True)]
        ying = bg_yaolist[["应" in i for i in bg_yaolist].index(True)]
        hour_status = self.find_shier_luck(gz[3][0])
        shi_luck = hour_status.get(shi[2])
        ying_luck = hour_status.get(ying[2])
        if shi_luck == "帝旺" or shi_luck == "临官" and ying_luck != "帝旺" or ying_luck != "临官":
            s_vs_y_dist = "世旺应衰者，我强彼弱，宜攻也。"
        if ying_luck == "帝旺" or ying_luck == "临官" and shi_luck != "帝旺" or shi_luck != "临官":
            s_vs_y_dist = "世衰应旺者，我弱彼强，宜守也。"
        if shi_luck == "帝旺" or shi_luck == "临官" and ying_luck == "帝旺" or ying_luck == "临官":
            s_vs_y_dist = "世应皆旺，必不交鋒，战亦胜负难决也。"
        else:
            s_vs_y_dist = "世应皆不旺，战亦胜负难决也。"
        shi_yy = {"阳": "世阳而动者，宜出师。", "阴": "世阴而静者，宜坚壁也。"}.get(
            self.multi_key_dict_get(yingyang, shi[1]))
        down_vs_up = self.multi_key_dict_get(wuxing_relation_2, downgua[1] + upgua[1])
        shi_vs_ying = self.find_wx_relation(shi[2], ying[2])
        shi_vs_ying2 = {"我克": "世克应爻，我军必胜",
                        "克我": "应克世爻，我军必败",
                        "比和": "世应比和，勢军力敌",
                        "我生": "世生应爻，我军不利",
                        "生我": "应生世爻，彼军不利",
                        }.get(shi_vs_ying)
        sy_monster = {"龙": "临【青龙】，良将也。",
                      "虎": "临【白虎】，猛将也。",
                      "陈": "临【勾陈】，密遣擒贼也。",
                      "雀": "临【朱雀】，号令严明也。",
                      "蛇": "临【螣蛇】，变幻不测也。",
                      "武": "临【玄武】，善用囊沙背水之术，或巧于偷营劫寨也。"}
        shi_monster = "世爻" + sy_monster.get(smons[b5.index("世")])
        ying_monster = "应爻" + sy_monster.get(smons[b5.index("应")])
        try:
            dongyao = re.findall(r'\d+', oo[4][1])[0]
        except IndexError:
            dongyao = "0"
        if shi[2] == daykong[0] or shi[2] == daykong[1] or shi[2] == hourkong[1] or shi[2] == hourkong[0]:
            sk_dist = "，世爻主队遇旬空，不利"
        else:
            sk_dist = ""
        god_dist1 = {"兄": "，忌神持世，不利", "父": "，仇神持世，不利", "妻": "，用神持世，有利", "子": "，原神持世，费心",
                     "官": "，泄神持世，有利"}
        god_dist2 = {"兄": "，忌神持应，不利", "父": "，仇神持应，不利", "妻": "，用神持应，有利", "子": "，原神持应，费心",
                     "官": "，泄神持应，有利"}
        s_dist2 = god_dist1.get(shi[0])
        y_dist2 = god_dist2.get(ying[0])
        s_dist3 = {"父": "父母持世，大败之兆",
                   "妻": "妻财持世，如旺相，如独发便嬴",
                   "官": "官鬼持世。皆败，乃彼我不得地，世旺克应，我胜；应旺克也，彼胜",
                   "兄": "兄弟持世，主有奸人在军中，世下伏鬼亦然",
                   "子": "子孙持世，如旺相，或独发便贏，若鬼兄财爻动便输"}.get(shi[0])
        if ying[2] == daykong[0] or ying[2] == daykong[1] or ying[2] == hourkong[1] or ying[2] == hourkong[0]:
            yk_dist = "，应爻客队遇旬空，不利"
        else:
            yk_dist = ""
        if "官" in shi == True:
            sguan = "，世见官鬼爻，皆败"
        else:
            sguan = ""
        if "官" in ying == True:
            yguan = "，应见官鬼爻，皆败"
        else:
            yguan = ""

        if dongyao == "0":
            if flyfu_dist == "":
                o = "【断主客胜负】\n1.客队下卦为【{}】，主队上卦为【{}】，主客关系为【{}】。内卦为我寨，处{}，外卦为彼营，处{}。{} \n2.主队世爻，{}世爻为【{}】{}{}{}，{}；{}客队应爻为【{}】{}{}{}，{}主客关系为【{}】，{}。\n3.日干下主队世爻临【{}】，客队应爻临【{}】，时干下{}{}".format(
                    downgua, upgua, down_vs_up, downgua1, upgua1, father_luck, shi_yy, shi[0:4], sk_dist, sguan,
                    s_dist2, s_dist3, shi_monster, ying[0:4], yk_dist, yguan, y_dist2, ying_monster, shi_vs_ying,
                    shi_vs_ying2, gettwelve.get(shi[2]), gettwelve.get(ying[2]), s_vs_y_dist, gua_no_yao)
            if flyfu_dist != "":
                o = "【断主客胜负】\n1.客队下卦为【{}】，主队上卦为【{}】，主客关系为【{}】。内卦为我寨，处{}，外卦为彼营，处{}。{} \n2.主队世爻，{}世爻为【{}】{}{}{}，{}；{}客队应爻为【{}】{}{}{}，{}主客关系为【{}】，{}。\n3.日干下主队世爻临【{}】，客队应爻临【{}】，时干下{}{} \n5.{}{}".format(
                    downgua, upgua, down_vs_up, downgua1, upgua1, father_luck, shi_yy, shi[0:4], sk_dist, sguan,
                    s_dist2, s_dist3, shi_monster, ying[0:4], yk_dist, yguan, y_dist2, ying_monster, shi_vs_ying,
                    shi_vs_ying2, gettwelve.get(shi[2]), gettwelve.get(ying[2]), s_vs_y_dist, gua_no_yao, flyfu_dist,
                    father_lay_dist)
        if dongyao != "0":
            try:
                num = int(ogua.index("9"))
                dong = bg_yaolist[int(ogua.index("9"))]
            except ValueError:
                num = int(ogua.index("6"))
                dong = bg_yaolist[int(ogua.index("6"))]
            if self.multi_key_dict_get(yingke, gz[2][1] + dong[2]) is None and self.multi_key_dict_get(yingke,
                                                                                                       gz[3][1] + dong[
                                                                                                           2]) is None:
                dd_dist = "动爻与日辰地支没有刑克。"
            if self.multi_key_dict_get(yingke, gz[2][1] + dong[2]) == "刑" or self.multi_key_dict_get(yingke,
                                                                                                      gz[3][1] + dong[
                                                                                                          2]) == "刑":
                dd_dist = "动爻与日辰地支刑克。"
            dong_dist = {"父": "【父母】爻发动，乃大败之兆。",
                         "官": "【官鬼】爻发动，我军不嬴。",
                         "子": "【子孙】爻发动，我军胜。",
                         "妻": "【妻财】爻发动，我军不利。",
                         "兄": "【兄弟】爻发动，凶，我军输。"}.get(dong[0])

            dong2 = self.multi_key_dict_get({(0, 1, 2): "动爻在下卦，即客队，", (3, 4, 5): "动爻在上卦，即主队，"}, num)
            if dong2[3] == "下":
                bian = eightgua.get(gb[0:3])
                vs = self.multi_key_dict_get(wuxing_relation_2, bian[1] + upgua[1])
            if dong2[3] == "上":
                bian = eightgua.get(gb[3:6])
                vs = self.multi_key_dict_get(wuxing_relation_2, downgua[1] + bian[1])
            try:
                vs2 = self.find_wx_relation(shi[2], dong[2])
                vs3 = self.find_wx_relation(ying[2], dong[2])
            except IndexError:
                vs2 = ""
                vs3 = ""
            if flyfu_dist == "":
                o = "【断主客胜负】\n1.客队下卦为【{}】，主队上卦为【{}】，主客关系为【{}】。内卦为我寨，处{}，外卦为彼营，处{}。{}\n2.主队世爻，{}世爻为【{}】{}{}{}，{}；{}客队应爻为【{}】{}{}{}，{}主客关系为【{}】，{}。 \n3.{}变为【{}】，主客关系为【{}】。 \n4.动爻【{}】，主队世爻【{}】，关系为【{}】。 \n5.动爻【{}】，客队应爻【{}】，关系为【{}】。\n6.{}。\n7.{} \n8.日干下主队世爻临【{}】，客队应爻临【{}】，时干下{}{}".format(
                    downgua, upgua, down_vs_up, downgua1, upgua1, father_luck, shi_yy, shi[0:4], sk_dist, sguan,
                    s_dist2, s_dist3, shi_monster, ying[0:4], yk_dist, yguan, y_dist2, ying_monster, shi_vs_ying,
                    shi_vs_ying2, dong2, bian, vs, dong[:-1], shi[0:4], vs2, dong[:-1], ying[0:4], vs3, dd_dist,
                    dong_dist, gettwelve.get(shi[2]), gettwelve.get(ying[2]), s_vs_y_dist, gua_no_yao)
            if flyfu_dist != "":
                o = "【断主客胜负】\n1.客队下卦为【{}】，主队上卦为【{}】，主客关系为【{}】。内卦为我寨，处{}，外卦为彼营，处{}。{}\n2.主队世爻，{}世爻为【{}】{}{}{}，{}；{}客队应爻为【{}】{}{}{}，{}主客关系为【{}】，{}。 \n3.{}变为【{}】，主客关系为【{}】。 \n4.动爻【{}】，主队世爻【{}】，关系为【{}】。 \n5.动爻【{}】，客队应爻【{}】，关系为【{}】。\n6.{}{}{} \n7.{} \n8.日干下主队世爻临【{}】，客队应爻临【{}】，时干下{}{}".format(
                    downgua, upgua, down_vs_up, downgua1, upgua1, father_luck, shi_yy, shi[0:4], sk_dist, sguan,
                    s_dist2, s_dist3, shi_monster, ying[0:4], yk_dist, yguan, y_dist2, ying_monster, shi_vs_ying,
                    shi_vs_ying2, dong2, bian, vs, dong[:-1], shi[0:4], vs2, dong[:-1], ying[0:4], vs3, dd_dist,
                    flyfu_dist, father_lay_dist, dong_dist, gettwelve.get(shi[2]), gettwelve.get(ying[2]), s_vs_y_dist,
                    gua_no_yao)
        p = "\n\n【周易策轨】\n\n先天策数\n"
        cg = self.innate_cegui(year, month, day, hour, minute)
        q = "{}\n{}\n{}\n{}\n\n".format("　".join(cg[0]), "　".join(cg[1]), "　".join(cg[2]), "　".join(cg[3]))
        r = "\n后天策数\n"
        hcg = self.acquired_cegui(year, month, day, hour, minute)
        s = "{}\n{}\n{}\n{}\n\n".format("　".join(hcg[0]), "　".join(hcg[1]), "　".join(hcg[2]), "　".join(hcg[3]))
        t = "{}\n\n".format(self.get_acquired_code(year, month, day, hour, minute))
        return a + b + c0 + c + c1 + c2 + p + q + r + s + t + c3 + c4 + c5 + c5_1 + d + e + f + g + h + i + j + k + l + m + n + o

    def display_pan(self, year, month, day, hour, minute):
        gz = self.gangzhi(year, month, day, hour, minute)
        oo = self.qigua_time_minute(year, month, day, hour, minute).get('大衍筮法')
        ogua = self.qigua_time_minute(year, month, day, hour, minute).get('大衍筮法')[0]
        bengua = self.qigua_time_minute(year, month, day, hour, minute).get("本卦")
        ggua = self.qigua_time_minute(year, month, day, hour, minute).get("之卦")
        gb = ogua.replace("9", "8").replace("6", "7")
        wugua = ogua.replace("9", "7").replace("6", "8")[1:4] + gb[2:5]
        b1 = self.qigua_time_minute(year, month, day, hour, minute).get("本卦").get("星宿")
        b2 = self.qigua_time_minute(year, month, day, hour, minute).get("本卦").get('六亲用神')
        b3 = self.qigua_time_minute(year, month, day, hour, minute).get("本卦").get('纳甲')
        b4 = self.qigua_time_minute(year, month, day, hour, minute).get("本卦").get('五行')
        b5 = self.qigua_time_minute(year, month, day, hour, minute).get("本卦").get('世应爻')
        g1 = self.qigua_time_minute(year, month, day, hour, minute).get("之卦").get("星宿")
        g2 = self.qigua_time_minute(year, month, day, hour, minute).get("之卦").get('六亲用神')
        g3 = self.qigua_time_minute(year, month, day, hour, minute).get("之卦").get('纳甲')
        g4 = self.qigua_time_minute(year, month, day, hour, minute).get("之卦").get('五行')
        g5 = self.qigua_time_minute(year, month, day, hour, minute).get("之卦").get('世应爻')
        try:
            gua_no_yao = {"父": "卦无【父母】，乃帜不备也。",
                          "妻": "卦无【妻财】，粮草缺绝也。",
                          "官": "卦无【官鬼】，如与鬼墓绝胎者，敌必遁去也。",
                          "子": "卦无【子孙】，动来救。",
                          "兄": "卦无【兄弟】，防奸细也。"}.get(list(set(list("官父妻兄子")) - set(b2))[0])
        except IndexError:
            gua_no_yao = ""
        guayaodict = {"6": "▅▅ ▅▅ X", "7": "▅▅▅▅▅  ", "8": "▅▅ ▅▅  ", "9": "▅▅▅▅▅ O"}
        # guayaodict = {"6":"▅▅　▅▅ X", "7":"▅▅▅▅▅  ", "8":"▅▅　▅▅  ", "9":"▅▅▅▅▅ O"}
        bg = [guayaodict.get(i) for i in list(ogua)]
        gb1 = [guayaodict.get(i) for i in list(gb)]
        wgb = [guayaodict.get(i) for i in list(wugua)]
        bg_yaolist = ["".join([b2[i], b3[i], b4[i], b5[i]]) for i in range(0, 6)]
        # gg_yaolist = ["".join([b2[i],b3[i],b4[i],b5[i]]) for i in range(0,6)]
        smons = self.find_six_mons(gz[2][0])
        lunar_month = self.lunar_date_d(year, month, day).get("月")
        build_month = self.find_lunar_month(gz[0]).get(lunar_month)
        dong_yaos = [i.replace("7", "").replace("8", "").replace("6", "动").replace("9", "动") for i in list(ogua)]
        qin_elements = dict(zip(b2, [b2[i] + b4[i] + dong_yaos[i] for i in range(0, 6)]))
        by = {
            0: ["身", "　", "　", "　", "　", "　"],
            1: ["　", "身", "　", "　", "　", "　"],
            2: ["　", "　", "身", "　", "　", "　"],
            3: ["　", "　", "　", "身", "　", "　"],
            4: ["　", "　", "　", "　", "身", "　"],
            5: ["　", "　", "　", "　", "　", "身"],
        }.get([b2[i] + b3[i] for i in range(0, 6)].index(bengua.get('身爻')[0:3]))
        try:
            fugod1 = bengua.get("伏神").get("伏神排爻数字")
            fugod2 = ggua.get("伏神").get("伏神排爻数字")
            fyao1 = bengua.get("伏神").get("伏神爻")
            fyao2 = ggua.get("伏神").get("伏神爻")
            fu_location = {0: [fyao1, "　　　　", "　　　　", "　　　　", "　　　　", "　　　　"],
                           1: ["　　　　", fyao1, "　　　　", "　　　　", "　　　　", "　　　　"],
                           2: ["　　　　", "　　　　", fyao1, "　　　　", "　　　　", "　　　　"],
                           3: ["　　　　", "　　　　", "　　　　", fyao1, "　　　　", "　　　　"],
                           4: ["　　　　", "　　　　", "　　　　", "　　　　", fyao1, "　　　　"],
                           5: ["　　　　", "　　　　", "　　　　", "　　　　", "　　　　", fyao1]}
            fu_location1 = {0: [fyao2, "　　　　", "　　　　", "　　　　", "　　　　", "　　　　"],
                            1: ["　　　　", fyao2, "　　　　", "　　　　", "　　　　", "　　　　"],
                            2: ["　　　　", "　　　　", fyao2, "　　　　", "　　　　", "　　　　"],
                            3: ["　　　　", "　　　　", "　　　　", fyao2, "　　　　", "　　　　"],
                            4: ["　　　　", "　　　　", "　　　　", "　　　　", fyao2, "　　　　"],
                            5: ["　　　　", "　　　　", "　　　　", "　　　　", "　　　　", fyao2]}
            fufu = fu_location.get(fugod1)
            fufu2 = fu_location1.get(fugod2)
            flylocation = bengua.get("伏神").get('本卦伏神所在爻')
            flygodyao = bengua.get("伏神").get('本卦伏神所在爻')[2:]
            fugodyao = fyao1[2:]
            if flylocation[0] == "父":
                father_lay_dist = {"子": "父下伏子，眾将慑服，擒纵如意也。",
                                   "妻": "父下伏财，备器足饷，智无遗算，但左右防伏戎也。",
                                   "兄": "父下伏兄，贪财好色，狎侮私人也。",
                                   "官": "父下伏鬼，智短计拙，动见疏虞也。"}.get(fyao1[0])
            else:
                father_lay_dist = ""
            flyfu_relation = self.find_wx_relation(flygodyao[0], fugodyao[0])
            if flyfu_relation == "我克":
                ff_relation = "我克】，飞来克伏为害，为凶。"
            if flyfu_relation == "克我":
                ff_relation = "克我】，伏克飞神为出暴，出暴者，凶而快。"
            if flyfu_relation == "比和":
                ff_relation = "比和】。"
            if flyfu_relation == "生我":
                ff_relation = flyfu_relation + "】。"
            if flyfu_relation == "我生":
                ff_relation = flyfu_relation + "】。"
            flyfu_dist = "伏神爻【" + fyao1 + "】，飞神【" + flygodyao + "】在【" + flylocation + "】，伏神【" + fugodyao + "】，飞伏关系为【" + ff_relation
        except AttributeError:
            fufu = ["　　　　", "　　　　", "　　　　", "　　　　", "　　　　", "　　　　"]
            fufu2 = ["　　　　", "　　　　", "　　　　", "　　　　", "　　　　", "　　　　"]
            flyfu_dist = ""
        daykong = self.daykong_shikong(year, month, day, hour, minute).get("日空")
        hourkong = self.daykong_shikong(year, month, day, hour, minute).get("时空")
        gettwelve = self.find_shier_luck(gz[2][0])
        twelvelucks = "".join([self.find_shier_luck(gz[2][0]).get(i) + "　" for i in self.dizhi])
        twelvelucks_hour = self.find_shier_luck(gz[3][0])
        twelvelucks_hour1 = "".join([self.find_shier_luck(gz[3][0]).get(i) + "　" for i in self.dizhi])
        try:
            father_luck = self.multi_key_dict_get(
                {("衰　", "病　", "死　", "墓　", "绝　"): "父母爻处衰绝，主队军师老髦也，守旧保守也。",
                 ("长生", "沐浴", "冠带", "临官", "帝旺"): "父母爻处旺相，主队军师少壮也，开明进取也。",
                 ("胎　", "养　"): "父母爻处胎、养，主队军师不威重也，欠谋略。"}, twelvelucks_hour.get(b3[b2.index("父")][1]))
        except (ValueError, IndexError):
            father_luck = ""
        a = "起卦时间︰{}年{}月{}日{}时{}分\n".format(year, month, day, hour, minute)
        b = "農曆︰{}{}月{}日\n".format(cn2an.transform(str(year) + "年", "an2cn"),
                                       an2cn(self.lunar_date_d(year, month, day).get("月")),
                                       an2cn(self.lunar_date_d(year, month, day).get("日")))
        c = "干支︰{}年  {}月  {}日  {}时\n".format(gz[0], gz[1], gz[2], gz[3])
        j_q = jq(year, month, day, hour, minute)
        c0 = "节气︰{} | 旺︰{} | 相︰{}\n".format(j_q, gong_wangzhuai(j_q)[1].get("旺"), gong_wangzhuai(j_q)[1].get("相"))
        c1 = "旬空︰　　　  　　　  {}    {}\n".format(daykong, hourkong)
        c2 = "月建︰　　　  {}\n\n".format(build_month)
        c3 = "　　　　" + "".join([i + "　　" for i in self.dizhi]) + "\n"
        c4 = "　　　　" + "".join([self.Ganzhiwuxing(i) + "　　" for i in self.dizhi]) + "\n"
        c5 = "日支运︰" + twelvelucks + "\n"
        c5_1 = "时支运︰" + twelvelucks_hour1 + "\n\n"
        d = "　　　　　　　       　 　{}卦　　　　　　　　　　 　　　　　              　  {}卦                \n".format(bengua.get("卦"),
                                                                                                  ggua.get("卦"))
        e = "六神　  伏神　　         本卦　　　　　　　　　　　       互卦               伏神　　   之卦\n"
        f = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}　\n".format(smons[5], fufu[5], b1[5],
                                                                                         b2[5], b3[5], b4[5],
                                                                                         twelvelucks_hour.get(b3[5][1]),
                                                                                         b5[5].replace("六", "　"),
                                                                                         bg[5], by[5], wgb[5], fufu2[5],
                                                                                         g1[5], g2[5], g3[5], g4[5],
                                                                                         g5[5].replace("六", "　"),
                                                                                         gb1[5])
        g = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}  \n".format(smons[4], fufu[4], b1[4],
                                                                                          b2[4], b3[4], b4[4],
                                                                                          twelvelucks_hour.get(
                                                                                              b3[4][1]),
                                                                                          b5[4].replace("五", "　"),
                                                                                          bg[4], by[4], wgb[4],
                                                                                          fufu2[4], g1[4], g2[4], g3[4],
                                                                                          g4[4],
                                                                                          g5[4].replace("五", "　"),
                                                                                          gb1[4])
        h = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}  \n".format(smons[3], fufu[3], b1[3],
                                                                                          b2[3], b3[3], b4[3],
                                                                                          twelvelucks_hour.get(
                                                                                              b3[3][1]),
                                                                                          b5[3].replace("四", "　"),
                                                                                          bg[3], by[3], wgb[3],
                                                                                          fufu2[3], g1[3], g2[3], g3[3],
                                                                                          g4[3],
                                                                                          g5[3].replace("四", "　"),
                                                                                          gb1[3])
        i = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}  \n".format(smons[2], fufu[2], b1[2],
                                                                                          b2[2], b3[2], b4[2],
                                                                                          twelvelucks_hour.get(
                                                                                              b3[2][1]),
                                                                                          b5[2].replace("三", "　"),
                                                                                          bg[2], by[2], wgb[2],
                                                                                          fufu2[2], g1[2], g2[2], g3[2],
                                                                                          g4[2],
                                                                                          g5[2].replace("三", "　"),
                                                                                          gb1[2])
        j = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}  \n".format(smons[1], fufu[1], b1[1],
                                                                                          b2[1], b3[1], b4[1],
                                                                                          twelvelucks_hour.get(
                                                                                              b3[1][1]),
                                                                                          b5[1].replace("二", "　"),
                                                                                          bg[1], by[1], wgb[1],
                                                                                          fufu2[1], g1[1], g2[1], g3[1],
                                                                                          g4[1],
                                                                                          g5[1].replace("二", "　"),
                                                                                          gb1[1])
        k = "　{} 　　{}　　 {} {}{}{} {} {}{} {}      {}      {}　　 {} {}{}{} {}{}  \n\n\n".format(smons[0], fufu[0], b1[0],
                                                                                              b2[0], b3[0], b4[0],
                                                                                              twelvelucks_hour.get(
                                                                                                  b3[0][1]),
                                                                                              b5[0].replace("初", "　"),
                                                                                              bg[0], by[0], wgb[0],
                                                                                              fufu2[0], g1[0], g2[0],
                                                                                              g3[0], g4[0],
                                                                                              g5[0].replace("初", "　"),
                                                                                              gb1[0])
        l = "【大衍筮法】\n"

        try:
            m = "求得【{}之{}】，{}{}{}\n\n".format(oo[1], oo[2], oo[4][0], oo[4][2], oo[4][3])
        except IndexError:
            m = "求得【{}之{}】，{}{}\n\n".format(oo[1], oo[2], oo[4][0], oo[4][2])
        n = "【{}卦】\n卦词︰{}\n彖︰{}\n{}\n{}\n{}\n{}\n{}\n{}\n\n".format(oo[1], oo[3].get(0), oo[3].get(7)[2:],
                                                                        oo[3].get(6), oo[3].get(5), oo[3].get(4),
                                                                        oo[3].get(3), oo[3].get(2), oo[3].get(1))
        eightgua = {'777': "乾金", '778': "兑金", '787': "离火", '788': "震木", '877': "巽木", '878': "坎水",
                    '887': "艮土", '888': "坤土"}
        downgua = eightgua.get(ogua[0:3].replace("6", "8").replace("9", "7"))
        upgua = eightgua.get(ogua[3:6].replace("6", "8").replace("9", "7"))
        status = {("旺", "相"): "，吉也", ("胎", "没"): "，平也", ("死", "囚", "休", "废"): "，凶也"}
        downgua1 = "【" + gong_wangzhuai(j_q)[0].get(downgua[0]) + "】" + self.multi_key_dict_get(status,
                                                                                                gong_wangzhuai(j_q)[
                                                                                                    0].get(downgua[0]))
        upgua1 = "【" + gong_wangzhuai(j_q)[0].get(upgua[0]) + "】" + self.multi_key_dict_get(status,
                                                                                            gong_wangzhuai(j_q)[0].get(
                                                                                                upgua[0]))
        shi = bg_yaolist[["世" in i for i in bg_yaolist].index(True)]
        ying = bg_yaolist[["应" in i for i in bg_yaolist].index(True)]
        hour_status = self.find_shier_luck(gz[3][0])
        shi_luck = hour_status.get(shi[2])
        ying_luck = hour_status.get(ying[2])
        if shi_luck == "帝旺" or shi_luck == "临官" and ying_luck != "帝旺" or ying_luck != "临官":
            s_vs_y_dist = "世旺应衰者，我强彼弱，宜攻也。"
        if ying_luck == "帝旺" or ying_luck == "临官" and shi_luck != "帝旺" or shi_luck != "临官":
            s_vs_y_dist = "世衰应旺者，我弱彼强，宜守也。"
        if shi_luck == "帝旺" or shi_luck == "临官" and ying_luck == "帝旺" or ying_luck == "临官":
            s_vs_y_dist = "世应皆旺，必不交鋒，战亦胜负难决也。"
        else:
            s_vs_y_dist = "世应皆不旺，战亦胜负难决也。"
        shi_yy = {"阳": "世阳而动者，宜出师。", "阴": "世阴而静者，宜坚壁也。"}.get(
            self.multi_key_dict_get(yingyang, shi[1]))
        down_vs_up = self.multi_key_dict_get(wuxing_relation_2, downgua[1] + upgua[1])
        shi_vs_ying = self.find_wx_relation(shi[2], ying[2])
        shi_vs_ying2 = {"我克": "世克应爻，我军必胜",
                        "克我": "应克世爻，我军必败",
                        "比和": "世应比和，勢军力敌",
                        "我生": "世生应爻，我军不利",
                        "生我": "应生世爻，彼军不利",
                        }.get(shi_vs_ying)
        sy_monster = {"龙": "临【青龙】，良将也。",
                      "虎": "临【白虎】，猛将也。",
                      "陈": "临【勾陈】，密遣擒贼也。",
                      "雀": "临【朱雀】，号令严明也。",
                      "蛇": "临【螣蛇】，变幻不测也。",
                      "武": "临【玄武】，善用囊沙背水之术，或巧于偷营劫寨也。"}
        shi_monster = "世爻" + sy_monster.get(smons[b5.index("世")])
        ying_monster = "应爻" + sy_monster.get(smons[b5.index("应")])
        dongyao = oo[4][0][4]
        if shi[2] == daykong[0] or shi[2] == daykong[1] or shi[2] == hourkong[1] or shi[2] == hourkong[0]:
            sk_dist = "，世爻主队遇旬空，不利"
        else:
            sk_dist = ""
        god_dist1 = {"兄": "，忌神持世，不利", "父": "，仇神持世，不利", "妻": "，用神持世，有利", "子": "，原神持世，费心",
                     "官": "，泄神持世，有利"}
        god_dist2 = {"兄": "，忌神持应，不利", "父": "，仇神持应，不利", "妻": "，用神持应，有利", "子": "，原神持应，费心",
                     "官": "，泄神持应，有利"}
        s_dist2 = god_dist1.get(shi[0])
        y_dist2 = god_dist2.get(ying[0])
        s_dist3 = {"父": "父母持世，大败之兆",
                   "妻": "妻财持世，如旺相，如独发便嬴",
                   "官": "官鬼持世。皆败，乃彼我不得地，世旺克应，我胜；应旺克也，彼胜",
                   "兄": "兄弟持世，主有奸人在军中，世下伏鬼亦然",
                   "子": "子孙持世，如旺相，或独发便贏，若鬼兄财爻动便输"}.get(shi[0])
        if ying[2] == daykong[0] or ying[2] == daykong[1] or ying[2] == hourkong[1] or ying[2] == hourkong[0]:
            yk_dist = "，应爻客队遇旬空，不利"
        else:
            yk_dist = ""
        if "官" in shi == True:
            sguan = "，世见官鬼爻，皆败"
        else:
            sguan = ""
        if "官" in ying == True:
            yguan = "，应见官鬼爻，皆败"
        else:
            yguan = ""
        if dongyao == "0":
            if flyfu_dist == "":
                o = "【断主客胜负】\n1.客队下卦为【{}】，主队上卦为【{}】，主客关系为【{}】。内卦为我寨，处{}，外卦为彼营，处{}。{} \n2.主队世爻，{}世爻为【{}】{}{}{}，{}；{}客队应爻为【{}】{}{}{}，{}主客关系为【{}】，{}。\n3.日干下主队世爻临【{}】，客队应爻临【{}】，时干下{}{}".format(
                    downgua, upgua, down_vs_up, downgua1, upgua1, father_luck, shi_yy, shi[0:4], sk_dist, sguan,
                    s_dist2, s_dist3, shi_monster, ying[0:4], yk_dist, yguan, y_dist2, ying_monster, shi_vs_ying,
                    shi_vs_ying2, gettwelve.get(shi[2]), gettwelve.get(ying[2]), s_vs_y_dist, gua_no_yao)
            if flyfu_dist != "":
                o = "【断主客胜负】\n1.客队下卦为【{}】，主队上卦为【{}】，主客关系为【{}】。内卦为我寨，处{}，外卦为彼营，处{}。{} \n2.主队世爻，{}世爻为【{}】{}{}{}，{}；{}客队应爻为【{}】{}{}{}，{}主客关系为【{}】，{}。\n3.日干下主队世爻临【{}】，客队应爻临【{}】，时干下{}{} \n5.{}{}".format(
                    downgua, upgua, down_vs_up, downgua1, upgua1, father_luck, shi_yy, shi[0:4], sk_dist, sguan,
                    s_dist2, s_dist3, shi_monster, ying[0:4], yk_dist, yguan, y_dist2, ying_monster, shi_vs_ying,
                    shi_vs_ying2, gettwelve.get(shi[2]), gettwelve.get(ying[2]), s_vs_y_dist, gua_no_yao, flyfu_dist,
                    father_lay_dist)
        if dongyao == "1":
            try:
                num = int(ogua.index("9"))
                dong = bg_yaolist[int(ogua.index("9"))]
            except ValueError:
                num = int(ogua.index("6"))
                dong = bg_yaolist[int(ogua.index("6"))]
            if self.multi_key_dict_get(yingke, gz[2][1] + dong[2]) is None and self.multi_key_dict_get(yingke,
                                                                                                       gz[3][1] + dong[
                                                                                                           2]) is None:
                dd_dist = "动爻与日辰地支没有刑克。"
            if self.multi_key_dict_get(yingke, gz[2][1] + dong[2]) == "刑" or self.multi_key_dict_get(yingke,
                                                                                                      gz[3][1] + dong[
                                                                                                          2]) == "刑":
                dd_dist = "动爻与日辰地支刑克。"
            dong_dist = {"父": "【父母】爻发动，乃大败之兆。",
                         "官": "【官鬼】爻发动，我军不嬴。",
                         "子": "【子孙】爻发动，我军胜。",
                         "妻": "【妻财】爻发动，我军不利。",
                         "兄": "【兄弟】爻发动，凶，我军输。"}.get(dong[0])

            dong2 = self.multi_key_dict_get({(0, 1, 2): "动爻在下卦，即客队，", (3, 4, 5): "动爻在上卦，即主队，"}, num)
            if dong2[3] == "下":
                bian = eightgua.get(gb[0:3])
                vs = self.multi_key_dict_get(wuxing_relation_2, bian[1] + upgua[1])
            if dong2[3] == "上":
                bian = eightgua.get(gb[3:6])
                vs = self.multi_key_dict_get(wuxing_relation_2, downgua[1] + bian[1])
            try:
                vs2 = self.find_wx_relation(shi[2], dong[2])
                vs3 = self.find_wx_relation(ying[2], dong[2])
            except IndexError:
                vs2 = ""
                vs3 = ""
            if flyfu_dist == "":
                o = "【断主客胜负】\n1.客队下卦为【{}】，主队上卦为【{}】，主客关系为【{}】。内卦为我寨，处{}，外卦为彼营，处{}。{}\n2.主队世爻，{}世爻为【{}】{}{}{}，{}；{}客队应爻为【{}】{}{}{}，{}主客关系为【{}】，{}。 \n3.{}变为【{}】，主客关系为【{}】。 \n4.动爻【{}】，主队世爻【{}】，关系为【{}】。 \n5.动爻【{}】，客队应爻【{}】，关系为【{}】。\n6.{}。\n7.{} \n8.日干下主队世爻临【{}】，客队应爻临【{}】，时干下{}{}".format(
                    downgua, upgua, down_vs_up, downgua1, upgua1, father_luck, shi_yy, shi[0:4], sk_dist, sguan,
                    s_dist2, s_dist3, shi_monster, ying[0:4], yk_dist, yguan, y_dist2, ying_monster, shi_vs_ying,
                    shi_vs_ying2, dong2, bian, vs, dong[:-1], shi[0:4], vs2, dong[:-1], ying[0:4], vs3, dd_dist,
                    dong_dist, gettwelve.get(shi[2]), gettwelve.get(ying[2]), s_vs_y_dist, gua_no_yao)
            if flyfu_dist != "":
                o = "【断主客胜负】\n1.客队下卦为【{}】，主队上卦为【{}】，主客关系为【{}】。内卦为我寨，处{}，外卦为彼营，处{}。{}\n2.主队世爻，{}世爻为【{}】{}{}{}，{}；{}客队应爻为【{}】{}{}{}，{}主客关系为【{}】，{}。 \n3.{}变为【{}】，主客关系为【{}】。 \n4.动爻【{}】，主队世爻【{}】，关系为【{}】。 \n5.动爻【{}】，客队应爻【{}】，关系为【{}】。\n6.{}{}{} \n7.{} \n8.日干下主队世爻临【{}】，客队应爻临【{}】，时干下{}{}".format(
                    downgua, upgua, down_vs_up, downgua1, upgua1, father_luck, shi_yy, shi[0:4], sk_dist, sguan,
                    s_dist2, s_dist3, shi_monster, ying[0:4], yk_dist, yguan, y_dist2, ying_monster, shi_vs_ying,
                    shi_vs_ying2, dong2, bian, vs, dong[:-1], shi[0:4], vs2, dong[:-1], ying[0:4], vs3, dd_dist,
                    flyfu_dist, father_lay_dist, dong_dist, gettwelve.get(shi[2]), gettwelve.get(ying[2]), s_vs_y_dist,
                    gua_no_yao)
        p = "\n\n【周易策轨】\n\n先天策数\n"
        cg = self.innate_cegui(year, month, day, hour, minute)
        q = "{}\n{}\n{}\n{}\n\n".format("　".join(cg[0]), "　".join(cg[1]), "　".join(cg[2]), "　".join(cg[3]))
        r = "\n后天策数\n"
        hcg = self.acquired_cegui(year, month, day, hour, minute)
        s = "{}\n{}\n{}\n{}\n\n".format("　".join(hcg[0]), "　".join(hcg[1]), "　".join(hcg[2]), "　".join(hcg[3]))
        t = "{}\n\n".format(self.get_acquired_code(year, month, day, hour, minute))
        return a + b + c0 + c + c1 + c2 + p + q + r + s + t + c3 + c4 + c5 + c5_1 + d + e + f + g + h + i + j + k + l + m + n + o


if __name__ == '__main__':
    # print(Iching().qigua_time_minute(2027, 11, 18, 0, 24))
    for i in range(1, 9999):
        print(Iching().display_pan(1127+i,2,13,5,20))
        #print(Iching().qigua_time(2027+i,1,1,0,0))